Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions service/submitqueue/demo/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ func TestSiblingFailureDoesNotCancelInFlightLand(t *testing.T) {
opts := fixtureOptions()
opts.Count, opts.Concurrency = 3, 3
landStarted := make(chan struct{})
thirdWaiting := make(chan struct{})
siblingsCancelled := make(chan struct{})
var landErr error
gateway := NewMockGateway(gomock.NewController(t))
Expand All @@ -347,9 +348,12 @@ func TestSiblingFailureDoesNotCancelInFlightLand(t *testing.T) {
readiness.EXPECT().Wait(gomock.Any(), gomock.Any()).DoAndReturn(func(gate context.Context, change Change) error {
switch {
case strings.HasSuffix(change.Branch, "/1"):
// Change 3 must be inside Wait before the gate cancels, or it is skipped and nothing releases Land.
<-landStarted
<-thirdWaiting
return fmt.Errorf("not ready")
case strings.HasSuffix(change.Branch, "/3"):
close(thirdWaiting)
<-gate.Done()
close(siblingsCancelled)
return gate.Err()
Expand Down