Skip to content

Fix flaky test TestReplMgr_ProcessBacklog

Sami Hiltunen requested to merge smh-fix-flaky-test-process-backlog into master

TestReplMgr_ProcessBacklog is asserting log statements outputted by ReplMgr when processing jobs. The test is currently waiting until the context is canceled before checking the log assertions. The context gets canceled when acknowleding a job in the queue. Not all log statements are printed out at that point yet, namely the 'replication job processing finished' would only be printed after acknowledging the job.

This commit fixes the race by making ProcessBacklog block until all goroutines launched from there have returned. The flaky test case blocks on the call, while rest of the code retains the existing behavior of running it asynchronously.

Closes #3392 (closed)

Edited by Sami Hiltunen

Merge request reports

Loading