detached af99e02

test(term): synchronize failed resize signal

commit
af99e02b86219463fed2b9198e342bc32b930313
author
brice · · 2026-07-25 08:13 UTC
parent
f9e1be4
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +3 -0
M internal/adapters/term/resize_test.go +3 -0
@@ -58,9 +58,11 @@ func TestResizeLoop_GetSizeErrorSkipsEmission(t *testing.T) {
5858 quit := make(chan struct{})
5959
6060 var calls int
61+ firstGetSize := make(chan struct{})
6162 getSize := func() (domain.Size, error) {
6263 calls++
6364 if calls == 1 {
65+ close(firstGetSize)
6466 return domain.Size{}, errors.New("boom")
6567 }
6668 return domain.Size{Cols: 10, Rows: 5}, nil
@@ -69,6 +71,7 @@ func TestResizeLoop_GetSizeErrorSkipsEmission(t *testing.T) {
6971 go resizeLoop(sig, out, quit, getSize)
7072
7173 sig <- syscall.SIGWINCH // errors; no emission
74+ <-firstGetSize // wait until the failed signal has been handled
7275 sig <- syscall.SIGWINCH // succeeds
7376
7477 got := <-out
@@ -58,9 +58,11 @@ func TestResizeLoop_GetSizeErrorSkipsEmission(t *testing.T) {
58 quit := make(chan struct{})58 quit := make(chan struct{})
59 59
60 var calls int60 var calls int
61+ firstGetSize := make(chan struct{})
61 getSize := func() (domain.Size, error) {62 getSize := func() (domain.Size, error) {
62 calls++63 calls++
63 if calls == 1 {64 if calls == 1 {
65+ close(firstGetSize)
64 return domain.Size{}, errors.New("boom")66 return domain.Size{}, errors.New("boom")
65 }67 }
66 return domain.Size{Cols: 10, Rows: 5}, nil68 return domain.Size{Cols: 10, Rows: 5}, nil
@@ -69,6 +71,7 @@ func TestResizeLoop_GetSizeErrorSkipsEmission(t *testing.T) {
69 go resizeLoop(sig, out, quit, getSize)71 go resizeLoop(sig, out, quit, getSize)
70 72
71 sig <- syscall.SIGWINCH // errors; no emission73 sig <- syscall.SIGWINCH // errors; no emission
74+ <-firstGetSize // wait until the failed signal has been handled
72 sig <- syscall.SIGWINCH // succeeds75 sig <- syscall.SIGWINCH // succeeds
73 76
74 got := <-out77 got := <-out

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close