R1-4: the module's unit tests end at 159, within the budget

The drain's rows join the stopping runtime's table, the settings reader joins the start's cases, and
the pull through a bundle's channel joins the take through it: 162 test functions become 159, every
case kept (review round 1, finding 4).

Builds: design 47 H2 §819
This commit is contained in:
2026-11-22 02:21:43 +01:00
parent cab76319b8
commit c90ff7d9c0
4 changed files with 177 additions and 196 deletions
+28 -29
View File
@@ -128,6 +128,34 @@ func TestABundleTakesASeatsWorkThroughItsOwnChannel(t *testing.T) {
t.Errorf("a publish with ack went the unacknowledged way: %v", b.published)
}
})
// 1887/A11: a bundle's pull reaches the runtime's bus from its own channel, as its other seat traffic does.
t.Run("ABundlesPullReachesTheRuntimeThroughItsOwnChannel", func(t *testing.T) {
entry := filepath.Join(t.TempDir(), "bundle")
if err := os.WriteFile(entry, []byte(pullingBundle), 0o755); err != nil {
t.Fatal(err)
}
b := &seating{}
l, err := Start("mesh-build-go", entry, os.Environ(), b, t.Logf)
if err != nil {
t.Fatal(err)
}
t.Cleanup(l.Stop)
for i := 0; ; i++ {
b.mu.Lock()
verb, params := b.verb, b.params
b.mu.Unlock()
if verb == "pull" {
if params != `{"worker":"SEAT_NODE_BUILD_GO_DELIVERY_worker","wait_ms":0}` {
t.Fatalf("pulled with %s", params)
}
return
}
if i > 100 {
t.Fatal("the bundle's pull never reached the runtime")
}
time.Sleep(20 * time.Millisecond)
}
})
}
// A bundle that pulls one ask from its worker when it is listed.
@@ -142,32 +170,3 @@ while IFS= read -r line; do
esac
done
`
// 1887/A11: a bundle's pull reaches the runtime's bus from its own channel, as its other seat traffic does.
func TestABundlePullsASeatsWorkThroughItsOwnChannel(t *testing.T) {
entry := filepath.Join(t.TempDir(), "bundle")
if err := os.WriteFile(entry, []byte(pullingBundle), 0o755); err != nil {
t.Fatal(err)
}
b := &seating{}
l, err := Start("mesh-build-go", entry, os.Environ(), b, t.Logf)
if err != nil {
t.Fatal(err)
}
t.Cleanup(l.Stop)
for i := 0; ; i++ {
b.mu.Lock()
verb, params := b.verb, b.params
b.mu.Unlock()
if verb == "pull" {
if params != `{"worker":"SEAT_NODE_BUILD_GO_DELIVERY_worker","wait_ms":0}` {
t.Fatalf("pulled with %s", params)
}
return
}
if i > 100 {
t.Fatal("the bundle's pull never reached the runtime")
}
time.Sleep(20 * time.Millisecond)
}
}