Skip to content

Commit 0ef39ff

Browse files
committed
Avoid data race in test
1 parent 0f3a857 commit 0ef39ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/test/e2e.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,14 +539,14 @@ func EndToEndBackendTest(t *testing.T, setup func() TestBackend, teardown func(b
539539
w := worker.New(b, workerOptions)
540540

541541
t.Cleanup(func() {
542+
cancel()
543+
542544
// Wait for in-progress executions to finish
543545
if err := w.WaitForCompletion(); err != nil {
544546
log.Println("Worker did not stop in time")
545547
t.FailNow()
546548
}
547549

548-
cancel()
549-
550550
if teardown != nil {
551551
teardown(b)
552552
}

0 commit comments

Comments
 (0)