Skip to content

Commit 30aded7

Browse files
facontidavideclaude
andcommitted
test(transform): wait for the ingest thread in the concurrency test
On a CI runner the main thread's 2000 iterations finished before the ingest thread had run once, so the final samples > 0 check failed. The loop now continues until the two threads have actually overlapped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01711BZcEtp3KsoF9uZHNFME
1 parent 26ec88b commit 30aded7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tests/unit/test_transform_set.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ TEST(TransformSetTest, RunIsSafeConcurrentlyWithBindFindAndStats) {
165165
bound->run("/a", in, out);
166166
}
167167
});
168-
for (int i = 0; i < 2000; ++i) {
168+
// Keep going until the ingest thread has really overlapped with us: on a busy
169+
// machine 2000 iterations can finish before it is even scheduled.
170+
for (int i = 0; i < 2000 || bound->samples.load() < 100; ++i) {
169171
(*set)->bind("/a", "pkg/msg/In");
170172
(*set)->bind("/other" + std::to_string(i % 8), "pkg/msg/In");
171173
(*set)->find("/a");

0 commit comments

Comments
 (0)