Skip to content

Commit

Permalink
check before shutting it off
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 3, 2024
1 parent b122a3c commit daedf7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions coverage/sysmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ def start(self) -> None:
@panopticon()
def stop(self) -> None:
"""Stop this Tracer."""
if not self.sysmon_on:
return
assert sys_monitoring is not None
try:
sys_monitoring.set_events(self.myid, 0)
for code in self.local_event_codes.values():
sys_monitoring.set_local_events(self.myid, code, 0)
self.local_event_codes = {}
sys_monitoring.free_tool_id(self.myid)
except ValueError: pass
sys_monitoring.set_events(self.myid, 0)
for code in self.local_event_codes.values():
sys_monitoring.set_local_events(self.myid, code, 0)
self.local_event_codes = {}
sys_monitoring.free_tool_id(self.myid)
self.sysmon_on = False

@panopticon()
Expand Down
1 change: 0 additions & 1 deletion tests/test_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ def random_load() -> None: # pragma: nested


@pytest.mark.skipif(env.WINDOWS, reason="SIGTERM doesn't work the same on Windows")
#@pytest.mark.skipif(env.METACOV and env.LINUX and env.PYVERSION >= (3, 12), reason="fuck this")
@flaky(max_runs=3) # Sometimes a test fails due to inherent randomness. Try more times.
class SigtermTest(CoverageTest):
"""Tests of our handling of SIGTERM."""
Expand Down

0 comments on commit daedf7e

Please sign in to comment.