Skip to content

Commit

Permalink
refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Neagu committed Mar 21, 2024
1 parent 7869229 commit 0ebfc44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker/activity_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ async def get(self):
"cpu_usage": {
"is_busy": self.activity_manager.cpu_usage_monitor.is_busy,
},
"disk_usage": {
"is_busy": self.activity_manager.disk_usage_monitor.is_busy
},
"kernel_monitor": {
"is_busy": self.activity_manager.jupyter_kernel_monitor.is_busy
},
Expand Down
2 changes: 2 additions & 0 deletions tests/test_activity_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ async def test_cpu_usage_monitor_not_busy(
stop=stop_after_delay(5), wait=wait_fixed(0.1), reraise=True
):
with attempt:
assert cpu_usage_monitor._get_total_cpu_usage() == 0
assert cpu_usage_monitor.is_busy is False


Expand All @@ -70,6 +71,7 @@ async def test_cpu_usage_monitor_still_busy(
time.sleep(1)

# must still result busy
assert cpu_usage_monitor._get_total_cpu_usage() > 0
assert cpu_usage_monitor.is_busy is True


Expand Down

0 comments on commit 0ebfc44

Please sign in to comment.