-
Notifications
You must be signed in to change notification settings - Fork 385
nextest timeouts don't work because cargo-miri doesn't propagate signals? #2421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Huh that's weird! How are you configuring the timeout? Are you using nextest's support for timeouts? Nextest sends SIGTERM to the child process (test), waits 10 seconds, then sends SIGKILL. This should be foolproof. |
Configured per your suggestion with |
Ahh that makes sense. Killing grandchild processes is a bit of a nightmare especially on Unix, so nextest doesn't try and do that at the moment (though that may change in the future). The cargo miri process run under nextest should probably forward the SIGTERM (and honestly do a SIGKILL after a couple of seconds) to the miri process. See this link: |
I guess the problem is that cargo-miri inserts itself between cargo (or, in this case, cargo-nextest) and the processes it spawns, to be able to adjust the flags. In an ideal world this would actually use POSIX
Hm, that seems surprising? If you do Ctrl-C in the shell, I think the shell does some magic and sends SIGINT to a whole load of processes (all processes attached to this terminal, or something like that?), and that's what makes it work. But a single targeted signal to |
As usual, you're right. Don't know what I was doing before, but if I |
On the nextest side I'm going to try setting up a process group (looks like Bazel does this for tests). |
In nextest-rs/nextest#393 I've switched nextest over to using process groups on Unix, which should address this on the nextest end. I'm also going to do a similar patch on Windows using job handles. |
nextest-rs/nextest#396 is the fix for Windows. Should aim to get a new release out tomorrow. |
FWIW this is addressed on nextest's end now, so the change in #2426 (while probably good in case the cargo-miri process gets a SIGTERM from some other source) isn't necessary for nextest. |
Yeah, I still definitely want the |
However, this issue has been addressed in nextest :) |
Use real exec on cfg(unix) targets Closes #2421 The standard library has a platform extension trait that lets us get the behavior we want on cfg(unix), so why not use it? I tried this out and it produces the correct behavior in concert with nextest.
cc @sunshowers
If I try to run
cargo miri nextest --no-fail-fast
with a long-running test that should be timed out, the Miri process executing the test doesn't exit, only the cargo-miri process that nextest is managing exits. I think this is because cargo-miri isn't passing along the SIGTERM to its child.That all sort of makes sense to me but I feel like I'm losing my mind because normal
cargo miri test
doesn't have this problem. If Ikill
any of the cargo-miri processes it takes down the Miri process as well. I've probably spent more time than I should trying to understand this, I think I'm just missing the Unix knowledge and understanding of how nextest works.The text was updated successfully, but these errors were encountered: