From 87357d84bdf632aacc2a2475432cfeca2f1a3c0b Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 18:31:59 +0100 Subject: [PATCH] mesh-delivery-pipeline: the queue and run tests make the module's findings stream Built against mesh-sdk at its pin (H-A-166, H-A-169), the runner counts every event no handler takes as a finding; with no stream for its finding events each write waited its 3 s for the bus, holding the event loop, so the queue test ran into its 90 s bound. The tests now make the stream the manifest asks for. Builds: design 47 H H-A-176, H-A-175 (the tests of the runner's placing), H-A-166, H-A-169 --- .../mesh-delivery-pipeline/queue_integration_test.go | 1 + .../mesh-delivery-pipeline/run_integration_test.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/queue_integration_test.go b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/queue_integration_test.go index e09f2b80..d16a1cb1 100644 --- a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/queue_integration_test.go +++ b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/queue_integration_test.go @@ -67,6 +67,7 @@ func TestTheQueueRunsPipelinesInTurn(t *testing.T) { if _, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: buscompose.LogStreamName(module, seat.StateStepLog), Subjects: []string{buscompose.LogSubject(module, seat.StateStepLog) + ".>"}}); err != nil { t.Fatal(err) } + findingsStream(t, ctx, js, module) events, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: process.EventsStream, Subjects: []string{"mesh.mod.*.event.>", "mesh.seat.*.event.>"}}) if err != nil { t.Fatal(err) diff --git a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/run_integration_test.go b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/run_integration_test.go index 1765d80e..5f7ce802 100644 --- a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/run_integration_test.go +++ b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/run_integration_test.go @@ -75,6 +75,7 @@ func TestTheRunnerPlacesAPipelineAsksItsBuildTakesItsEndAndAnswersAReview(t *tes if _, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: buscompose.LogStreamName(module, seat.StateStepLog), Subjects: []string{buscompose.LogSubject(module, seat.StateStepLog) + ".>"}}); err != nil { t.Fatal(err) } + findingsStream(t, ctx, js, module) events, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: process.EventsStream, Subjects: []string{"mesh.mod.*.event.>", "mesh.seat.*.event.>"}}) if err != nil { t.Fatal(err) @@ -283,6 +284,16 @@ func readPipeline(ctx context.Context, kv jetstream.KeyValue, key string, p *sea } // waitFor asks cond until it holds or the test's context ends, the module's journal in the failure. +// findingsStream makes the stream of the module's own finding events, as its manifest's streams ask the bus for +// (`mesh.stream..event.>`), so a finding the runner writes, such as the unhandled-event count of the SDK's view +// reader (H-A-166, H-A-169), is acknowledged at once and holds no event behind its 3 s wait for the bus. +func findingsStream(t *testing.T, ctx context.Context, js jetstream.JetStream, module string) { + t.Helper() + if _, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: module + "-findings", Subjects: []string{"mesh.stream." + module + ".event.>"}}); err != nil { + t.Fatal(err) + } +} + func waitFor(t *testing.T, ctx context.Context, logs *syncBuffer, cond func() bool) { t.Helper() for ctx.Err() == nil {