detached 1459232

test(ci): stabilize cross-platform async coverage

commit
145923258844040bc7691afef7257234fbc1523b
author
brice · · 2026-08-08 04:22 UTC
parent
9265275
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +18 -8
M packages/agent/modes/session_dialog_test.go +8 -6
@@ -13,6 +13,8 @@ import (
1313 "github.com/bnema/zut/packages/tui"
1414 )
1515
16+const sessionDialogTestTimeout = 10 * time.Second
17+
1618 func TestFormatSessionRowPlainSanitizesControlBytes(t *testing.T) {
1719 row := formatSessionRowPlain(core.SessionSummary{
1820 Provider: "test\x1b]0;bad\a",
@@ -149,12 +151,12 @@ func TestSessionDialogCancellationDoesNotEmitFinished(t *testing.T) {
149151 t.Fatalf("first load event = %+v, open %v; want sessionLoadStarted", event, ok)
150152 }
151153 d.ApplyLoad(event)
152- case <-time.After(time.Second):
154+ case <-time.After(sessionDialogTestTimeout):
153155 t.Fatal("timed out waiting for sessionLoadStarted")
154156 }
155157 select {
156158 case <-entered:
157- case <-time.After(time.Second):
159+ case <-time.After(sessionDialogTestTimeout):
158160 t.Fatal("timed out waiting for the session worker")
159161 }
160162
@@ -173,7 +175,7 @@ func TestSessionDialogCancellationDoesNotEmitFinished(t *testing.T) {
173175 t.Fatal("canceled load emitted sessionLoadFinished")
174176 }
175177 d.ApplyLoad(event)
176- case <-time.After(time.Second):
178+ case <-time.After(sessionDialogTestTimeout):
177179 t.Fatal("timed out waiting for canceled session load to close")
178180 }
179181 }
@@ -221,12 +223,12 @@ func TestSessionDialogPreCanceledOpenPreservesPreviousLoadBarrier(t *testing.T)
221223 t.Fatalf("first load event = %+v, open %v; want sessionLoadStarted", event, ok)
222224 }
223225 d.ApplyLoad(event)
224- case <-time.After(time.Second):
226+ case <-time.After(sessionDialogTestTimeout):
225227 t.Fatal("timed out waiting for the first load to start")
226228 }
227229 select {
228230 case <-entered:
229- case <-time.After(time.Second):
231+ case <-time.After(sessionDialogTestTimeout):
230232 t.Fatal("timed out waiting for the first worker")
231233 }
232234
@@ -253,7 +255,7 @@ func TestSessionDialogPreCanceledOpenPreservesPreviousLoadBarrier(t *testing.T)
253255 t.Fatalf("third load event = %+v, open %v; want sessionLoadStarted after barrier", event, ok)
254256 }
255257 d.ApplyLoad(event)
256- case <-time.After(time.Second):
258+ case <-time.After(sessionDialogTestTimeout):
257259 t.Fatal("timed out waiting for third load after releasing the first")
258260 }
259261 cancelThird()
@@ -13,6 +13,8 @@ import (
13 "github.com/bnema/zut/packages/tui"13 "github.com/bnema/zut/packages/tui"
14 )14 )
15 15
16+const sessionDialogTestTimeout = 10 * time.Second
17+
16 func TestFormatSessionRowPlainSanitizesControlBytes(t *testing.T) {18 func TestFormatSessionRowPlainSanitizesControlBytes(t *testing.T) {
17 row := formatSessionRowPlain(core.SessionSummary{19 row := formatSessionRowPlain(core.SessionSummary{
18 Provider: "test\x1b]0;bad\a",20 Provider: "test\x1b]0;bad\a",
@@ -149,12 +151,12 @@ func TestSessionDialogCancellationDoesNotEmitFinished(t *testing.T) {
149 t.Fatalf("first load event = %+v, open %v; want sessionLoadStarted", event, ok)151 t.Fatalf("first load event = %+v, open %v; want sessionLoadStarted", event, ok)
150 }152 }
151 d.ApplyLoad(event)153 d.ApplyLoad(event)
152- case <-time.After(time.Second):154+ case <-time.After(sessionDialogTestTimeout):
153 t.Fatal("timed out waiting for sessionLoadStarted")155 t.Fatal("timed out waiting for sessionLoadStarted")
154 }156 }
155 select {157 select {
156 case <-entered:158 case <-entered:
157- case <-time.After(time.Second):159+ case <-time.After(sessionDialogTestTimeout):
158 t.Fatal("timed out waiting for the session worker")160 t.Fatal("timed out waiting for the session worker")
159 }161 }
160 162
@@ -173,7 +175,7 @@ func TestSessionDialogCancellationDoesNotEmitFinished(t *testing.T) {
173 t.Fatal("canceled load emitted sessionLoadFinished")175 t.Fatal("canceled load emitted sessionLoadFinished")
174 }176 }
175 d.ApplyLoad(event)177 d.ApplyLoad(event)
176- case <-time.After(time.Second):178+ case <-time.After(sessionDialogTestTimeout):
177 t.Fatal("timed out waiting for canceled session load to close")179 t.Fatal("timed out waiting for canceled session load to close")
178 }180 }
179 }181 }
@@ -221,12 +223,12 @@ func TestSessionDialogPreCanceledOpenPreservesPreviousLoadBarrier(t *testing.T)
221 t.Fatalf("first load event = %+v, open %v; want sessionLoadStarted", event, ok)223 t.Fatalf("first load event = %+v, open %v; want sessionLoadStarted", event, ok)
222 }224 }
223 d.ApplyLoad(event)225 d.ApplyLoad(event)
224- case <-time.After(time.Second):226+ case <-time.After(sessionDialogTestTimeout):
225 t.Fatal("timed out waiting for the first load to start")227 t.Fatal("timed out waiting for the first load to start")
226 }228 }
227 select {229 select {
228 case <-entered:230 case <-entered:
229- case <-time.After(time.Second):231+ case <-time.After(sessionDialogTestTimeout):
230 t.Fatal("timed out waiting for the first worker")232 t.Fatal("timed out waiting for the first worker")
231 }233 }
232 234
@@ -253,7 +255,7 @@ func TestSessionDialogPreCanceledOpenPreservesPreviousLoadBarrier(t *testing.T)
253 t.Fatalf("third load event = %+v, open %v; want sessionLoadStarted after barrier", event, ok)255 t.Fatalf("third load event = %+v, open %v; want sessionLoadStarted after barrier", event, ok)
254 }256 }
255 d.ApplyLoad(event)257 d.ApplyLoad(event)
256- case <-time.After(time.Second):258+ case <-time.After(sessionDialogTestTimeout):
257 t.Fatal("timed out waiting for third load after releasing the first")259 t.Fatal("timed out waiting for third load after releasing the first")
258 }260 }
259 cancelThird()261 cancelThird()
M packages/agent/subagents/runner_e2e_test.go +10 -2
@@ -66,12 +66,16 @@ func TestExecRunnerDeadlineGracefullyStopsWorkerAndPreservesStreamedOutput(t *te
6666 t.Setenv("ZUT_STUB_BLOCK_INITIAL", "1")
6767
6868 root := t.TempDir()
69+ inboxPath, err := inboxSocketPath(root, "deadline-test")
70+ if err != nil {
71+ t.Fatalf("inboxSocketPath: %v", err)
72+ }
6973 a := &Agent{
7074 ID: "deadline-test",
7175 Task: "long-running task",
7276 Dir: root,
7377 SessionPath: filepath.Join(root, "session.jsonl"),
74- InboxPath: filepath.Join(root, "inbox.sock"),
78+ InboxPath: inboxPath,
7579 EventLogPath: filepath.Join(root, "events.jsonl"),
7680 }
7781 a.inbox = NewInbox(a.InboxPath)
@@ -145,12 +149,16 @@ func TestExecRunnerCancelsBlockedWorker(t *testing.T) {
145149 t.Setenv("ZUT_STUB_BLOCK_INITIAL", "1")
146150
147151 root := t.TempDir()
152+ inboxPath, err := inboxSocketPath(root, "cancel-test")
153+ if err != nil {
154+ t.Fatalf("inboxSocketPath: %v", err)
155+ }
148156 a := &Agent{
149157 ID: "cancel-test",
150158 Task: "blocked task",
151159 Dir: root,
152160 SessionPath: filepath.Join(root, "session.jsonl"),
153- InboxPath: filepath.Join(root, "inbox.sock"),
161+ InboxPath: inboxPath,
154162 EventLogPath: filepath.Join(root, "events.jsonl"),
155163 }
156164 a.inbox = NewInbox(a.InboxPath)
@@ -66,12 +66,16 @@ func TestExecRunnerDeadlineGracefullyStopsWorkerAndPreservesStreamedOutput(t *te
66 t.Setenv("ZUT_STUB_BLOCK_INITIAL", "1")66 t.Setenv("ZUT_STUB_BLOCK_INITIAL", "1")
67 67
68 root := t.TempDir()68 root := t.TempDir()
69+ inboxPath, err := inboxSocketPath(root, "deadline-test")
70+ if err != nil {
71+ t.Fatalf("inboxSocketPath: %v", err)
72+ }
69 a := &Agent{73 a := &Agent{
70 ID: "deadline-test",74 ID: "deadline-test",
71 Task: "long-running task",75 Task: "long-running task",
72 Dir: root,76 Dir: root,
73 SessionPath: filepath.Join(root, "session.jsonl"),77 SessionPath: filepath.Join(root, "session.jsonl"),
74- InboxPath: filepath.Join(root, "inbox.sock"),78+ InboxPath: inboxPath,
75 EventLogPath: filepath.Join(root, "events.jsonl"),79 EventLogPath: filepath.Join(root, "events.jsonl"),
76 }80 }
77 a.inbox = NewInbox(a.InboxPath)81 a.inbox = NewInbox(a.InboxPath)
@@ -145,12 +149,16 @@ func TestExecRunnerCancelsBlockedWorker(t *testing.T) {
145 t.Setenv("ZUT_STUB_BLOCK_INITIAL", "1")149 t.Setenv("ZUT_STUB_BLOCK_INITIAL", "1")
146 150
147 root := t.TempDir()151 root := t.TempDir()
152+ inboxPath, err := inboxSocketPath(root, "cancel-test")
153+ if err != nil {
154+ t.Fatalf("inboxSocketPath: %v", err)
155+ }
148 a := &Agent{156 a := &Agent{
149 ID: "cancel-test",157 ID: "cancel-test",
150 Task: "blocked task",158 Task: "blocked task",
151 Dir: root,159 Dir: root,
152 SessionPath: filepath.Join(root, "session.jsonl"),160 SessionPath: filepath.Join(root, "session.jsonl"),
153- InboxPath: filepath.Join(root, "inbox.sock"),161+ InboxPath: inboxPath,
154 EventLogPath: filepath.Join(root, "events.jsonl"),162 EventLogPath: filepath.Join(root, "events.jsonl"),
155 }163 }
156 a.inbox = NewInbox(a.InboxPath)164 a.inbox = NewInbox(a.InboxPath)

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 1

Tags 476

↑↓ moveenter openesc close