J26 item 2: the run-ask test expects a program's exit 7 to end its key failed

Since A-290 a run whose program exited other than 0 ends its key failed, the
reason saying the exit, its answer kept (steprun.finish); the test still
wanted passed. It now wants failed with "the program exited 7" and reads the
kept answer as before.

Builds: design 47 G A-290

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 18:06:06 +01:00
parent 49ab6c00ea
commit ec646f55ee
@@ -27,7 +27,7 @@ import (
// answered on its step key <node>.<ask id>: the program, run shut off over its heads and its input (asked by digest of the
// seat verb the ask names, which a fake checker answers on the bus as the checker's verb input does), answers its last
// line and exit; a program cannot write under its heads, and one
// that dials the machine's network is shut off, and the answer says it failed.
// that dials the machine's network is shut off, and its key ends failed, the answer kept (design 47 G A-290).
func TestARunAskIsAnsweredOnTheBusAndItsProgramIsShutOff(t *testing.T) {
needTools(t, "the shut-off run", "bash", "bwrap")
nc, err := nats.Connect(testbus.URL(t))
@@ -122,8 +122,9 @@ func TestARunAskIsAnsweredOnTheBusAndItsProgramIsShutOff(t *testing.T) {
break
}
}
if step.State != sdkstep.StepPassed {
t.Fatalf("the run ask ended %q: %s", step.State, step.Reason)
// A run whose program exited other than 0 ends its key failed, saying the exit, its answer kept (design 47 G A-290).
if step.State != sdkstep.StepFailed || !strings.HasPrefix(step.Reason, "the program exited 7") {
t.Fatalf("the run ask ended %q: %s; want failed, the program exited 7", step.State, step.Reason)
}
var ans sdkstep.RunAnswer
if err := json.Unmarshal(step.Result, &ans); err != nil {