test(gpu): the gate test's control run waits until its detector has seen the race (M1)

The run without the gate only proves the detector works, but it had 300 ms to
see an overlap, and on CI's Linux runner (busy with the software GPU tests) its
threads sometimes had not run by then: it failed twice in a row on this branch.
It now goes on until it has seen one, for at most 30 s.
This commit is contained in:
Tanish Manku committed 2026-11-17 21:11:44 -07:00
1 parent 6c1d1459d2
commit 448c7aefbb
1 file changed
+5 -1
+5 -1
View File
@@ -167,7 +167,11 @@ mod tests {
.collect();
let mut overlaps = 0;
let until = Instant::now() + Duration::from_millis(300);
while Instant::now() < until {
// The run without the gate goes on until its detector has seen an overlap (it must:
// the threads submit nearly all the time), however long a busy machine takes to
// let them run at all. On CI's Linux runner 300 ms could pass before any did.
let patience = Instant::now() + Duration::from_secs(30);
while Instant::now() < until || (!gated && overlaps == 0 && Instant::now() < patience) {
// A frame: the gate is open for a moment.
gate.open();
std::thread::sleep(Duration::from_micros(200));