From 533a076eb33da1dff447c447797d50418826dbcf Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 17 Nov 2026 13:05:11 +0100 Subject: [PATCH 1/2] runner: test 109 asserts a queued ask has no bound in the state bounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The case of a test run waiting with its holder present was asserted just after placing, so a five-minute bound put back on the ask failed no test; test 109 now reads the state bounds after the asks are put and holds only drops' keys there. Builds: design 47 G §647 (as A-466y amends it), §535 --- .../testruns_integration_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go index 6ec49142..5e13693f 100644 --- a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go +++ b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go @@ -329,6 +329,20 @@ func TestTestRunsAreAskedOncePerLevelAndMoveEveryReader(t *testing.T) { if s := step(read(p3), "app:tools", "unit"); s.Outcome != seat.StepResultOutcomeWaitingForABuildNode || s.Ask != "" || s.Shared[0].Ask != unit.Ask { t.Fatalf("the tools' unit step = %+v; want it waiting for a build node, reading the program's run", s) } + // Its wait has no bound (§647 as A-466y amends it): the state bounds holds no key for a queued ask, only drops' keys. + boundsKV, err := js.KeyValue(ctx, module+"_bounds") + if err != nil { + t.Fatal(err) + } + if ks, err := boundsKV.Keys(ctx); err != nil && err != jetstream.ErrNoKeysFound { + t.Fatal(err) + } else { + for _, k := range ks { + if !strings.HasPrefix(k, pipeline.DropBoundPrefix) { + t.Errorf("the state bounds holds %s after the asks were put; want no bound of a queued ask", k) + } + } + } // A runner restarted during a run takes it up again by its ask (§725): the run's end, heard after the restart, ends both. taken(unit.Ask) From ae105b4631b49e54fd243837f556332764570825 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 17 Nov 2026 13:06:46 +0100 Subject: [PATCH 2/2] runner: test 109 reads a step's end said again from EVENTS through a durable consumer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The runner keeps no message id on its step events (A-470t), so the bus's deduplication drops no end said again (A-470q); test 109 now reads the tools' unit step-ended from the stream through a durable consumer, its first end failed and the end said again by the move passed, both kept. Builds: design 47 G §727; A-470d, A-470q, A-470t --- .../testruns_integration_test.go | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go index 5e13693f..7dd35123 100644 --- a/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go +++ b/modules/mesh-delivery-pipeline/cmd/mesh-delivery-pipeline/testruns_integration_test.go @@ -82,6 +82,12 @@ func TestTestRunsAreAskedOncePerLevelAndMoveEveryReader(t *testing.T) { if _, err := events.CreateOrUpdateConsumer(ctx, jetstream.ConsumerConfig{Durable: "n1_" + module, AckPolicy: jetstream.AckExplicitPolicy}); err != nil { t.Fatal(err) } + // A durable consumer of the runner's step-ended in EVENTS, so an end said again is read as the stream keeps it (A-470q). + stepEnds, err := events.CreateOrUpdateConsumer(ctx, jetstream.ConsumerConfig{Durable: "t109-step-ended", + FilterSubject: "mesh.seat." + seat.Seat + ".event." + seat.EventStepEnded + ".>", AckPolicy: jetstream.AckExplicitPolicy}) + if err != nil { + t.Fatal(err) + } if _, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: "ASKS", Subjects: []string{"mesh.seat.*.accept.>"}, Retention: jetstream.WorkQueuePolicy}); err != nil { t.Fatal(err) } @@ -422,6 +428,29 @@ func TestTestRunsAreAskedOncePerLevelAndMoveEveryReader(t *testing.T) { if s := step(p, "app:tools", "unit"); s.Outcome != seat.StepResultOutcomePassed || !s.Rerun { t.Errorf("the tools' unit step = %+v; want moved to passed, marked a rerun", s) } + // The tools' unit step's ends, read from the stream: its first, failed, and its end said again by the move, passed. + var toolEnds []string + for { + batch, err := stepEnds.FetchNoWait(100) + if err != nil { + t.Fatal(err) + } + n := 0 + for m := range batch.Messages() { + n++ + var e seat.StepEvent + if json.Unmarshal(m.Data(), &e) == nil && e.Pipeline == p3 && e.Result.Artifact == "app:tools" && e.Result.Step == "unit" { + toolEnds = append(toolEnds, e.Result.Outcome) + } + _ = m.Ack() + } + if n == 0 { + break + } + } + if len(toolEnds) < 2 || toolEnds[0] != seat.StepResultOutcomeFailed || toolEnds[len(toolEnds)-1] != seat.StepResultOutcomePassed { + t.Errorf("the tools' unit step-ended in EVENTS = %v; want its first end failed and the end said again passed, both kept", toolEnds) + } if s := step(p, "app:program", "integration"); s.Outcome != seat.StepResultOutcomeAccepted { t.Errorf("the accepted step = %+v; want it accepted still", s) }