Skip to content
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

[nextest-runner] use grace period on receiving Windows Ctrl-C #1984

Merged
merged 4 commits into from
Dec 15, 2024

Conversation

sunshowers
Copy link
Member

@sunshowers sunshowers commented Dec 14, 2024

Previously on Windows, we would not do anything at all on receiving Ctrl-C, letting tests exit on their own.

With this change, in case of Ctrl-C, nextest will apply the same grace period that it does on Unix. By default, nextest will now wait 10 seconds before calling TerminateJobObject on the test. Like on Unix, a double Ctrl-C will kill the test immediately.

The behavior in case of timeouts is unchanged -- call TerminateJobObject immediately.

This PR also has a few more fixes to Windows display, and to cancellation on all platforms.

Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 82.14286% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.62%. Comparing base (208d6e5) to head (c433be1).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
nextest-runner/src/runner/dispatcher.rs 81.81% 4 Missing ⚠️
nextest-runner/src/runner/executor.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1984      +/-   ##
==========================================
- Coverage   80.62%   80.62%   -0.01%     
==========================================
  Files          95       95              
  Lines       23071    23094      +23     
==========================================
+ Hits        18602    18620      +18     
- Misses       4469     4474       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

trunk-io bot commented Dec 14, 2024

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Previously on Windows, we would not do anything at all on receiving Ctrl-C,
letting tests exit on their own.

With this change, in case of Ctrl-C, nextest will apply the same grace period
that it does on Unix. By default, nextest will now wait 10 seconds before
calling `TerminateJobObject` on the test. Like on Unix, a double Ctrl-C will
kill the test immediately.

The behavior in case of timeouts is unchanged -- call `TerminateJobObject`
immediately.
@sunshowers sunshowers force-pushed the ctrl-c-terminate branch 4 times, most recently from 24ce512 to c1abd3f Compare December 15, 2024 01:09
While cancelling a run, it was previously possible for new units to
be registered. Make it so that the receiver returns None in this case.
Gives the dispatcher a chance to control communication.
@sunshowers sunshowers merged commit b6b7077 into main Dec 15, 2024
19 checks passed
@sunshowers sunshowers deleted the ctrl-c-terminate branch December 15, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant