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

Restore CTRL-C handling by setting new flag in libmamba #340

Merged
merged 23 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b5976fc
call pthred_sigmask to restore CTRL-C handling
dholth Oct 28, 2023
0c50882
use upcoming use_default_signal_handler if available
jaimergp Oct 28, 2023
4a729a8
flip logic here for clarity
jaimergp Oct 28, 2023
42c1345
ensure new group and use BREAK instead
jaimergp Oct 30, 2023
37b346f
timeout here too, just in case
jaimergp Oct 30, 2023
b6eb8cc
that flag is only importable on win
jaimergp Oct 30, 2023
c9c5c3e
Merge branch 'main' into pthread-sigmask-ctrl-c
jaimergp Oct 30, 2023
955155d
try with ctrl-c again (but separate group)
jaimergp Oct 31, 2023
eb1e30e
Merge branch 'pthread-sigmask-ctrl-c' of github.com:dholth/conda-libm…
jaimergp Oct 31, 2023
be422a6
Update conda_libmamba_solver/mamba_utils.py
dholth Nov 1, 2023
ceb7951
Merge branch 'main' into pthread-sigmask-ctrl-c
jaimergp Nov 1, 2023
8210974
Merge branch 'main' into pthread-sigmask-ctrl-c
jezdez Nov 1, 2023
63c7e22
remove sigmask
jaimergp Nov 1, 2023
e391254
amend news
jaimergp Nov 1, 2023
395182b
Fix ctrlc tests on Windows.
jezdez Nov 1, 2023
fe9e8aa
Merge branch 'pthread-sigmask-ctrl-c' of https://github.com/dholth/co…
jezdez Nov 1, 2023
3df8fb4
Update tests/test_workarounds.py
dholth Nov 2, 2023
f84b9ed
Use a pytest finalizer for resetting the windows ctrl-c handler.
jezdez Nov 2, 2023
1346f16
No finalizer.
jezdez Nov 2, 2023
f5ce2e2
Fix import.
jezdez Nov 2, 2023
f455785
Rerun all failures.
jezdez Nov 2, 2023
585d8b9
Install pytest-rerunfailures
jezdez Nov 2, 2023
ca5e2c3
Fix for real.
jezdez Nov 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use a pytest finalizer for resetting the windows ctrl-c handler.
jezdez committed Nov 2, 2023
commit f84b9edf6b241fd11f5d8ab29b5e866647c75beb
15 changes: 6 additions & 9 deletions tests/test_workarounds.py
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ def test_build_string_filters():


@pytest.mark.parametrize("stage", ["Collecting package metadata", "Solving environment"])
def test_ctrl_c(stage):
def test_ctrl_c(stage, request):
p = sp.Popen(
[
sys.executable,
@@ -97,13 +97,10 @@ def test_ctrl_c(stage):
kernel.AttachConsole(p.pid)
kernel.SetConsoleCtrlHandler(None, 1)
kernel.GenerateConsoleCtrlEvent(0, 0)
p.wait(timeout=30)
assert p.returncode != 0
assert "KeyboardInterrupt" in p.stdout.read() + p.stderr.read()
kernel.SetConsoleCtrlHandler(None, 0)

request.addfinalizer(lambda: kernel.SetConsoleCtrlHandler(None, 0))
else:
p.send_signal(signal.SIGINT)
p.wait(timeout=30)
assert p.returncode != 0
assert "KeyboardInterrupt" in p.stdout.read() + p.stderr.read()

p.wait(timeout=30)
assert p.returncode != 0
assert "KeyboardInterrupt" in p.stdout.read() + p.stderr.read()