diff --git a/modules/mesh-delivery-sdk/steprun/pull_integration_test.go b/modules/mesh-delivery-sdk/steprun/pull_integration_test.go index c7a7ed35..a8e01162 100644 --- a/modules/mesh-delivery-sdk/steprun/pull_integration_test.go +++ b/modules/mesh-delivery-sdk/steprun/pull_integration_test.go @@ -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} {