Keep a failed toolchain probe a loud refusal; only the command directory is fixed (issue 734, review round 1)
Declining an ask whose probe failed would turn a truly broken toolchain into a wait of up to the decline bound that then fails with an empty "needs a node with" reason. With the node-engine no longer deleting a running build and commands started in a directory that exists, the getwd cause is gone, so the guard's refusal stays as it was. The decline refactor goes with it.
This commit is contained in:
@@ -139,8 +139,7 @@ func TestPullHoldsAtMostItsCapacity(t *testing.T) {
|
||||
|
||||
// An ask that is not one, or not this seat's, is dropped and runs nowhere. And issue 890/AC1: a check ask needing
|
||||
// node-build-node is declined on a node that lacks it (its step refused as declined, naming what it lacks, the message
|
||||
// dropped for the asker to put again), and runs on a node that has it. And issue 734: an ask whose run is refused to
|
||||
// ask again (a toolchain that could not be read) is declined the same way, not refused for good.
|
||||
// dropped for the asker to put again), and runs on a node that has it.
|
||||
func TestPullDropsWhatIsNoAsk(t *testing.T) {
|
||||
src, st := NewFakeAsks(), newSteps()
|
||||
src.Publish(delivery.AskDelivery, []byte(`{"v":1}`))
|
||||
@@ -174,21 +173,6 @@ func TestPullDropsWhatIsNoAsk(t *testing.T) {
|
||||
Run: func(ctx context.Context, a delivery.StepAsk) (any, error) { return nil, nil }}
|
||||
go q.Pull(ctx)
|
||||
waitFor(t, "the placed ask acked where its need is met", func() bool { a, _, _ := has.Fates(); return len(a) == 1 })
|
||||
|
||||
probe, probeSteps := NewFakeAsks(), newSteps()
|
||||
unready := testAsk(delivery.AskCheck)
|
||||
_ = probe.PublishAsk(unready)
|
||||
r := &Puller{Source: probe, Language: delivery.AskGo, Node: "ace", Put: probeSteps.put, Capacity: func() int { return 1 },
|
||||
PullWait: 10 * time.Millisecond, Run: func(ctx context.Context, a delivery.StepAsk) (any, error) {
|
||||
return nil, &Refusal{Text: "the installed go version could not be read: getwd: no such file or directory", Again: true}
|
||||
}}
|
||||
go r.Pull(ctx)
|
||||
waitFor(t, "the unready ask termed", func() bool { _, tm, _ := probe.Fates(); return len(tm) == 1 })
|
||||
key, _ = delivery.AskStepKey("ace", unready.ID)
|
||||
s, _ = probeSteps.get(key)
|
||||
if _, ok := delivery.DeclinedOf(s); !ok || !strings.Contains(s.Reason, "getwd") {
|
||||
t.Fatalf("the step of an ask its node could not run now = %+v, want it declined naming why", s)
|
||||
}
|
||||
}
|
||||
|
||||
// load reads the recorded steps state's raw values: the pause key is not a step, so it is kept apart.
|
||||
|
||||
Reference in New Issue
Block a user