steprun: the pull-order test asserts the kinds' turns, as the code has since 2026-11-15
TestPullOrderAndCapacityOnTheBus still asserted deliveries first, red since773f89e9made the build seats' queue kinds take turns (not since83d45421: it fails at 83d45421^ too). It now asserts a delivery, then the check in its turn, then the other delivery; it fails on a pull that takes deliveries first. Builds: design 47 H H-A-41, H-A-117, H-A-120; G A-440 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -62,8 +62,9 @@ func askKey(a sdkstep.StepAsk, node string) (string, error) {
|
||||
return sdkstep.AskStepKey("mesh-wants", node, a.ID)
|
||||
}
|
||||
|
||||
// 1887/A2a, 1887/AC-order, 1887/AC-pull on the real server: a check ask published before a delivery ask runs after it;
|
||||
// with capacity 2 and three asks two run, the third waits in the stream and starts when one ends.
|
||||
// 1887/AC-pull, G A-440, H H-A-120 on the real server: the kinds take turns, so with a check ask published before two
|
||||
// delivery asks the pull takes a delivery, then the check, then the other delivery; with capacity 2 and three asks two
|
||||
// run, the third waits in the stream and starts when one ends.
|
||||
func TestPullOrderAndCapacityOnTheBus(t *testing.T) {
|
||||
js := askBus(t, 30*time.Second)
|
||||
check, first, second := testAsk(sdkstep.AskCheck), testAsk(sdkstep.AskDelivery), testAsk(sdkstep.AskDelivery)
|
||||
@@ -89,12 +90,17 @@ func TestPullOrderAndCapacityOnTheBus(t *testing.T) {
|
||||
waitFor(t, "two in hand", func() bool { return p.InHand() == 2 })
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
mu.Lock()
|
||||
if len(order) != 2 || order[0] != first.ID || order[1] != second.ID {
|
||||
t.Fatalf("ran %v, want the two delivery asks %s %s first", order, first.ID, second.ID)
|
||||
if len(order) != 2 || order[0] != first.ID || order[1] != check.ID {
|
||||
t.Fatalf("ran %v, want a delivery ask %s, then the check ask %s in its turn", order, first.ID, check.ID)
|
||||
}
|
||||
mu.Unlock()
|
||||
release <- struct{}{}
|
||||
waitFor(t, "the check taken", func() bool { mu.Lock(); defer mu.Unlock(); return len(order) == 3 })
|
||||
waitFor(t, "the other delivery taken", func() bool { mu.Lock(); defer mu.Unlock(); return len(order) == 3 })
|
||||
mu.Lock()
|
||||
if order[2] != second.ID {
|
||||
t.Fatalf("ran %v, want the delivery ask %s third", order, second.ID)
|
||||
}
|
||||
mu.Unlock()
|
||||
close(release)
|
||||
waitFor(t, "every step ended", func() bool {
|
||||
for _, a := range []sdkstep.StepAsk{check, first, second} {
|
||||
|
||||
Reference in New Issue
Block a user