Skip to content
Merged
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
7 changes: 7 additions & 0 deletions tests/round_robin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ static test_return_t _job_retry_TEST(Context *context, Limit& limit)
NULL, 0, // workload
NULL, // result size
&rc));

// Join the background worker thread before inspecting limit's counters:
// job_retry_WORKER (running on that thread) writes limit->_count with no
// synchronization, so reading it here without a join first is a data race
// (and can observe a stale/torn value if the worker is still mid-retry).
handle->shutdown();

ASSERT_EQ(uint32_t(limit.expected()), uint32_t(limit.count()));
ASSERT_EQ(limit.response(), rc);

Expand Down
Loading