detached 5a4e492

test(swarm): wait for inbox listener before send

commit
5a4e4923f2ec1c7402c0b57e7e3a11520537f157
author
patriceckhart · · 2026-06-17 14:38 UTC
parent
d5d0754
signature
unsigned
refs
tag: v0.2.36
1 file · +10 -0
M packages/agent/modes/swarm_slash_test.go +10 -0
@@ -102,6 +102,7 @@ func TestRunSwarmNewSpawnsAgent(t *testing.T) {
102102 func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) {
103103 root := t.TempDir()
104104 recv := make(chan string, 4)
105+ ready := make(chan error, 1)
105106 f := swarm.New(swarm.Config{
106107 Root: root,
107108 RepoRoot: root,
@@ -112,6 +113,7 @@ func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) {
112113 // something to talk to. The runner-test stubs do the
113114 // same; this is the minimum to exercise the wire.
114115 ln, err := swarm.Listen(a.InboxPath)
116+ ready <- err
115117 if err != nil {
116118 return err
117119 }
@@ -138,6 +140,14 @@ func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) {
138140 if err != nil {
139141 t.Fatalf("spawn: %v", err)
140142 }
143+ select {
144+ case err := <-ready:
145+ if err != nil {
146+ t.Fatalf("listen: %v", err)
147+ }
148+ case <-time.After(5 * time.Second):
149+ t.Fatal("timed out waiting for agent inbox listener")
150+ }
141151
142152 // Run /swarm send <id> <text...>. The dispatcher would have
143153 // already strings.Fields-ed the input; mirror that here.
@@ -102,6 +102,7 @@ func TestRunSwarmNewSpawnsAgent(t *testing.T) {
102 func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) {102 func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) {
103 root := t.TempDir()103 root := t.TempDir()
104 recv := make(chan string, 4)104 recv := make(chan string, 4)
105+ ready := make(chan error, 1)
105 f := swarm.New(swarm.Config{106 f := swarm.New(swarm.Config{
106 Root: root,107 Root: root,
107 RepoRoot: root,108 RepoRoot: root,
@@ -112,6 +113,7 @@ func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) {
112 // something to talk to. The runner-test stubs do the113 // something to talk to. The runner-test stubs do the
113 // same; this is the minimum to exercise the wire.114 // same; this is the minimum to exercise the wire.
114 ln, err := swarm.Listen(a.InboxPath)115 ln, err := swarm.Listen(a.InboxPath)
116+ ready <- err
115 if err != nil {117 if err != nil {
116 return err118 return err
117 }119 }
@@ -138,6 +140,14 @@ func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) {
138 if err != nil {140 if err != nil {
139 t.Fatalf("spawn: %v", err)141 t.Fatalf("spawn: %v", err)
140 }142 }
143+ select {
144+ case err := <-ready:
145+ if err != nil {
146+ t.Fatalf("listen: %v", err)
147+ }
148+ case <-time.After(5 * time.Second):
149+ t.Fatal("timed out waiting for agent inbox listener")
150+ }
141 151
142 // Run /swarm send <id> <text...>. The dispatcher would have152 // Run /swarm send <id> <text...>. The dispatcher would have
143 // already strings.Fields-ed the input; mirror that here.153 // already strings.Fields-ed the input; mirror that here.

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