Skip to content

Commit 1381d66

Browse files
committed
Prevent errors due to canceled contexts in test
1 parent 70a34a3 commit 1381d66

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/test/e2e.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,14 @@ func EndToEndBackendTest(t *testing.T, setup func() TestBackend, teardown func(b
476476
w := worker.New(b, workerOptions)
477477

478478
t.Cleanup(func() {
479-
cancel()
479+
// Wait for in-progress executions to finish
480480
if err := w.WaitForCompletion(); err != nil {
481481
log.Println("Worker did not stop in time")
482482
t.FailNow()
483483
}
484484

485+
cancel()
486+
485487
if teardown != nil {
486488
teardown(b)
487489
}

0 commit comments

Comments
 (0)