The deferred-open test stops racing a thread spawn
Browse files at this commit77c6364326bbd33cbc86c49e322d2cb9c584d9f1Parent: 1c45bb6- fix
- the deferred-open test stops racing a thread spawn
1 changed file +7 -5
crates/engine/src/decode.rsmodified+7 -5
| @@ -1427,11 +1427,13 @@ mod tests { | ||
| 1427 | 1427 | "the first frame arrived within the call ({first_frame:?} vs \ |
| 1428 | 1428 | {returned:?}), which cannot happen if the open is deferred" |
| 1429 | 1429 | ); |
| 1430 | - assert!( | |
| 1431 | - returned < sync_returned, | |
| 1432 | - "the deferred open ({returned:?}) cost as much as the sync one \ | |
| 1433 | - ({sync_returned:?}): the demux is still on the caller's thread" | |
| 1434 | - ); | |
| 1430 | + // No `returned < sync_returned` here on purpose: on a loaded machine | |
| 1431 | + // a thread spawn (what the deferred open pays) can cost more wall | |
| 1432 | + // clock than a whole sync demux of a small fixture, and the race | |
| 1433 | + // flaked one run in three under a parallel build. The two asserts | |
| 1434 | + // above already pin the invariant -- the call returns in microseconds | |
| 1435 | + // territory and the demux happens after it, on the worker. | |
| 1436 | + let _ = sync_returned; | |
| 1435 | 1437 | } |
| 1436 | 1438 | |
| 1437 | 1439 | /// The late-picture policy, at the one place it is decided. A worker told |