diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go index 8c5ad01e..4aa96b37 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go @@ -95,15 +95,17 @@ type machineEnd struct { // run runs one composition step and answers what it came to: per machine not away it joins or starts the candidate's // composition run (§718), waits for each run's end in its key, and judges each machine from it; failed when a machine does not -// compose, could not run when a machine could not be composed or was not judged, else passed with a warning per machine away. +// compose, could not run when a machine could not be composed or was not judged, nothing to run when no node places the module on +// the branch (H-A-179), else passed with a warning per machine away. func (r *compositionRun) run(ctx context.Context, id string, step meshwants.StepRun) stepOutcome { candidate, err := candidateKeyOf(step) if err != nil { return couldNotRun(err.Error()) } nodes := r.inputs.machines(step.Module, step.Branch) - if len(nodes) == 0 { - return couldNotRun(fmt.Sprintf("no node places %s on the branch %q, so the composition step has no machine to compose", step.Module, step.Branch)) + if len(nodes) == 0 { // a mover no machine holds on the branch has nothing to judge: nothing to run, passed (H-A-179, ADR 0682 §8) + return stepOutcome{Outcome: meshwants.StepEndedOutcomeNothingToRun, + Said: fmt.Sprintf("no node places %s on the branch %q, so the composition step has no machine to compose", step.Module, step.Branch)} } reader := readerOf(id, step) prep := &runPrep{r: r, step: step} diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun_test.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun_test.go index 9bf5111e..b1ca1d06 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun_test.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun_test.go @@ -259,7 +259,11 @@ func TestTheCompositionStepRunsOneAskPerMachine(t *testing.T) { } none := newRunStand(t, "src2:e1", "src2:e1", "d1") none.r.inputs.machines = func(string, string) []string { return machines } - if out := none.r.run(context.Background(), "ask-step", step); out.Outcome != meshwants.StepEndedOutcomeCouldNotRun || + outcome := meshwants.StepEndedOutcomeCouldNotRun + if len(machines) == 0 { // a mover no machine holds: nothing to run, saying why (H-A-179) + outcome = meshwants.StepEndedOutcomeNothingToRun + } + if out := none.r.run(context.Background(), "ask-step", step); out.Outcome != outcome || !strings.Contains(out.Said, want) || (len(machines) > 0 && !strings.Contains(out.Said, "shanks is away")) || len(none.asks) != 0 { t.Errorf("%s came to %+v, %d asks", name, out, len(none.asks)) }