P12 queue-test-waits-on-causes: the queue test waits for the restarted runner's own take-ins line and asserts no clock between restart and end

Builds: design 47 H2 H-A-637 (kind), H-A-710 (rows of the runner)
This commit is contained in:
2026-11-25 18:07:51 +01:00
parent 48038105fc
commit 78813b0bcf
@@ -384,7 +384,10 @@ func testTheQueueRunsPipelinesInTurn(t *testing.T) {
t.Fatal(err)
}
before := pipelineKeys(t, ctx, pipelines)
heardBefore := takeInsLines(logs)
stopRunner = start()
// The restarted runner is waited for by what it says it did, its own take-ins line, never by a clock (H-A-637's kind).
takeInsHeardMore(t, ctx, logs, heardBefore)
outcome("main.10", seat.PipelineOutcomeRunning)
waitFor(t, ctx, logs, func() bool { return wasSaid("wait-ended.main.10") && slices.Equal(running(), []string{"main.10"}) })
waitFor(t, ctx, logs, func() bool { _, ok := finding(pipeline.PipelinesStalledKind); return !ok })
@@ -417,8 +420,10 @@ func testTheQueueRunsPipelinesInTurn(t *testing.T) {
restarted := time.Now()
stopRunner = start()
outcome("main.10", seat.PipelineOutcomeFailed)
if e := stepFor(get("main.10"), "app", seat.StepResultStepBuild).Ended; e == nil || e.Sub(restarted) >= 3*time.Second {
t.Fatalf("main.10's build ended %v, the runner restarted at %v; want its missed bound taken at the start", e, restarted)
// The missed bound is taken by the restarted runner: the step ends after the restart and the journal says so below; no
// clock between the restart and the end is asserted, which a loaded machine stretches (H-A-637's kind).
if e := stepFor(get("main.10"), "app", seat.StepResultStepBuild).Ended; e == nil || e.Before(restarted) {
t.Fatalf("main.10's build ended %v, the runner restarted at %v; want its missed bound taken by the restarted runner", e, restarted)
}
if !strings.Contains(logs.String(), "expired while the runner was away: taken now") {
t.Fatal("the start did not say the bound it took")