compiletest: Fix deadline bugs in new executor by Zalathar · Pull Request #140031 · rust-lang/rust (original) (raw)

The experimental new executor for compiletest (#139660) was found to have two major bugs in deadline handling for detecting slow tests:

This PR fixes those bugs.

(The new executor is not yet enabled by default, so this PR has no immediate effect on contributors.)


I noted in #139998 (comment) that I hoped to have some unit tests to accompany these fixes. Unfortunately that turned out to be infeasible, because DeadlineQueue is tightly coupled to concrete mpsc::Receiver APIs (in addition to Instant::now), and trying to mock all of those would make the code much more complicated.

I did, however, add a few assertions that would have caught the failure to remove tests from the queue after their deadline.

r? jieyouxu