Skip to content

Fix flaky cancel worker jobs test

Administrator requested to merge es/fix-flaky-cancel-jobs-test into main

Created by: eseliger

Sometimes the .After wasn't called when we advanced the clock, leading to it waiting from that point in time. BlockingAdvance waits for an .After handler to attach.

Closes https://github.com/sourcegraph/sourcegraph/issues/39749

Test plan

Verified it never flakes anymore:

go test ./internal/workerutil -run=TestWorkerCancelJobs -count=1000000
ok      github.com/sourcegraph/sourcegraph/internal/workerutil  39.729s

Merge request reports

Loading