Skip to content

Commit

Permalink
Refactor test_gil_contention
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Apr 26, 2023
1 parent c942dc9 commit 9dc79c6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions distributed/tests/test_system_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,17 @@ def test_gil_contention():
a = sm.update()
assert "gil_contention" in a

assert sm._gilknocker.is_running
sm.close()
sm.close() # Idempotent
assert not sm._gilknocker.is_running

sm = SystemMonitor(monitor_gil_contention=False)
a = sm.update()
assert "gil_contention" not in a

assert dask.config.get("distributed.admin.system-monitor.gil.enabled")

with dask.config.set({"distributed.admin.system-monitor.gil.enabled": False}):
sm = SystemMonitor()
a = sm.update()
assert "gil_contention" not in a

sm = SystemMonitor()
a = sm.update()

assert sm._gilknocker.is_running
sm.close()
sm.close() # Idempotent
assert not sm._gilknocker.is_running

0 comments on commit 9dc79c6

Please sign in to comment.