From d638856768260a283a463bb6c3c3a9a59ed6277d Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 18:37:29 +0100 Subject: [PATCH] Asker rename R2: the build modules' tests read a named ask's step under its asker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 G §481, §483, A-163 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- .../cmd/mesh-build-go/asks_integration_test.go | 6 +++++- modules/mesh-build-go/cmd/mesh-build-go/asks_test.go | 2 +- .../cmd/mesh-build-go/compose_integration_test.go | 2 +- .../mesh-build-go/cmd/mesh-build-go/run_integration_test.go | 2 +- modules/mesh-build-image/cmd/mesh-build-image/asks_test.go | 2 +- modules/mesh-build-node/cmd/mesh-build-node/asks_test.go | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/asks_integration_test.go b/modules/mesh-build-go/cmd/mesh-build-go/asks_integration_test.go index 9fe1d64d0..b1b9bc13c 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/asks_integration_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/asks_integration_test.go @@ -87,7 +87,11 @@ func TestTheModuleTakesADeliveryAskBeforeAnEarlierCheck(t *testing.T) { ended := 0 states.mu.Lock() for _, a := range []sdkstep.StepAsk{first, check} { - key, _ := sdkstep.AskStepKey("ace", a.ID) + asker := "mesh-delivery-checker" // a named ask's step is keyed under its asker, main's under its node (§481) + if a.Kind == sdkstep.AskDelivery { + asker = "" + } + key, _ := sdkstep.AskStepKey(asker, "ace", a.ID) v := append([]sdkstep.Step(nil), states.steps[key]...) ran[a.ID] = v if len(v) > 0 && v[len(v)-1].State != sdkstep.StepRunning { diff --git a/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go b/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go index e68553468..b8e3f6802 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go @@ -57,7 +57,7 @@ func TestAPulledAskRunsTheBuildAndItsKeyNamesTheReference(t *testing.T) { ctx, stop := context.WithCancel(context.Background()) defer stop() go p.Pull(ctx) - key, _ := sdkstep.AskStepKey("ace", a.ID) + key, _ := sdkstep.AskStepKey("", "ace", a.ID) var step sdkstep.Step for deadline := time.Now().Add(30 * time.Second); ; time.Sleep(5 * time.Millisecond) { states.mu.Lock() diff --git a/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go b/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go index c793c02b7..ed2923b9e 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/compose_integration_test.go @@ -212,7 +212,7 @@ func TestAComposeAskIsBuiltOnceAndAnsweredOnTheBus(t *testing.T) { if _, err := js.Publish(ctx, subject, raw); err != nil { t.Fatal(err) } - key, _ := sdkstep.AskStepKey("ace", a.ID) + key, _ := sdkstep.AskStepKey("", "ace", a.ID) for deadline := time.Now().Add(90 * time.Second); time.Now().Before(deadline); time.Sleep(50 * time.Millisecond) { states.mu.Lock() v := states.steps[key] diff --git a/modules/mesh-build-go/cmd/mesh-build-go/run_integration_test.go b/modules/mesh-build-go/cmd/mesh-build-go/run_integration_test.go index 771d5d540..e09f87c49 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/run_integration_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/run_integration_test.go @@ -111,7 +111,7 @@ func TestARunAskIsAnsweredOnTheBusAndItsProgramIsShutOff(t *testing.T) { if _, err := js.Publish(ctx, subject, raw); err != nil { t.Fatal(err) } - stepKey, _ := sdkstep.AskStepKey("ace", a.ID) + stepKey, _ := sdkstep.AskStepKey("", "ace", a.ID) var step sdkstep.Step for deadline := time.Now().Add(60 * time.Second); time.Now().Before(deadline); time.Sleep(50 * time.Millisecond) { states.mu.Lock() diff --git a/modules/mesh-build-image/cmd/mesh-build-image/asks_test.go b/modules/mesh-build-image/cmd/mesh-build-image/asks_test.go index 4c9caabd4..7b6767599 100644 --- a/modules/mesh-build-image/cmd/mesh-build-image/asks_test.go +++ b/modules/mesh-build-image/cmd/mesh-build-image/asks_test.go @@ -43,7 +43,7 @@ func TestAPulledImageAskCopiesThenBuilds(t *testing.T) { ctx, stop := context.WithCancel(context.Background()) defer stop() go p.Pull(ctx) - key, _ := sdkstep.AskStepKey("ace", a.ID) + key, _ := sdkstep.AskStepKey("", "ace", a.ID) var step sdkstep.Step for deadline := time.Now().Add(3 * time.Second); ; time.Sleep(5 * time.Millisecond) { states.mu.Lock() diff --git a/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go b/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go index 00c148906..8bafad60c 100644 --- a/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go +++ b/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go @@ -70,7 +70,7 @@ func TestAPulledNodeAskRunsItsJob(t *testing.T) { if got := strings.Join(calls, ","); got != "build_node_fetch,build_node_build,build_node_fetch,build_node_test" { t.Errorf("calls = %s, want the delivery ask's job first, then the check's", got) } - key, _ := sdkstep.AskStepKey("ace", build.ID) + key, _ := sdkstep.AskStepKey("", "ace", build.ID) states.mu.Lock() v := states.steps[key] states.mu.Unlock()