diff --git a/modules/mesh-delivery-pipeline/internal/pipeline/drops.go b/modules/mesh-delivery-pipeline/internal/pipeline/drops.go index 7e4b8abf8..ed81f85f1 100644 --- a/modules/mesh-delivery-pipeline/internal/pipeline/drops.go +++ b/modules/mesh-delivery-pipeline/internal/pipeline/drops.go @@ -110,7 +110,7 @@ func (s *Starter) dropEnded(p seat.Pipeline, prior []seat.StepResult, unput []As // The end cleared these steps' asks, so their ask keys go here, not with the end's own (H-A-506 addendum); a shared // test run's key goes with the run's end (H-A-506 corrected). for _, st := range steps { - if sharedRun(st) == "" { + if sharedRun(st) == "" || st.Seat == wants.Seat { // only a test run's key waits for the run's end unmarkAsk(s.Clock, st.Ask, s.logf) } } diff --git a/modules/mesh-delivery-pipeline/internal/pipeline/steps.go b/modules/mesh-delivery-pipeline/internal/pipeline/steps.go index d64333138..0c26785f7 100644 --- a/modules/mesh-delivery-pipeline/internal/pipeline/steps.go +++ b/modules/mesh-delivery-pipeline/internal/pipeline/steps.go @@ -523,7 +523,7 @@ func (h *Hearer) said(p seat.Pipeline, asked []int, ended bool) error { // Every ask key of its steps goes with the pipeline's end (H-A-506 addendum), but a shared test run's: another // pipeline may still read the run, and its key goes with the run's end (H-A-500 addendum (1), H-A-506 corrected). for _, st := range p.Steps { - if sharedRun(st) == "" { + if sharedRun(st) == "" || st.Seat == wants.Seat { // only a test run's key waits for the run's end unmarkAsk(h.Clock, st.Ask, h.logf) } } diff --git a/modules/mesh-delivery-pipeline/internal/pipeline/testruns_test.go b/modules/mesh-delivery-pipeline/internal/pipeline/testruns_test.go index 008384478..60a47cb9a 100644 --- a/modules/mesh-delivery-pipeline/internal/pipeline/testruns_test.go +++ b/modules/mesh-delivery-pipeline/internal/pipeline/testruns_test.go @@ -420,6 +420,15 @@ func TestATestRunsEndMovesEveryReaderAndIsCountedOnce(t *testing.T) { if s := stepNamed(c.pipeline(p), "", "composition"); len(s.Shared) != 1 || s.Shared[0] != (seat.Shared{Machine: "ace", Run: "main.9.ace", Ask: "r1"}) { t.Errorf("the composition step's shared = %+v, want mesh-wants' as it came", s.Shared) } + // Its own ask key goes with the pipeline's end: a mesh-wants step's shared runs are no test run whose end deletes it + // (H-A-506 addendum, corrected). + _ = c.clock.MarkAsk(comp.Ask, AskMark{Pipeline: p.Pipeline, Step: "composition"}) + if err := c.h.said(c.pipeline(p), nil, true); err != nil { + t.Fatal(err) + } + if _, ok, _ := c.clock.AskOf(comp.Ask); ok { + t.Errorf("the composition's ask key %s outlives its pipeline's end", comp.Ask) + } } // Asking a test run again moves every reader (design 47 G ยง727; A-469l, A-470d, A-470e): a rerun of one artifact's failed