Skip to content

Commit cad20d7

Browse files
committed
attempt to fix flaky test
1 parent acdc028 commit cad20d7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_cli_run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def _should_update_task(last_update, update_frequency_seconds):
5252
return True
5353

5454
with mock.patch("taskbadger.process._should_update", new=_should_update_task):
55-
_test_cli_run(["echo test; sleep 0.11"], 0, args=["task_name"], update_call_count=3)
55+
update_mock = _test_cli_run(["echo test; sleep 0.2"], 0, args=["task_name"], update_call_count=0)
56+
assert update_mock.call_count > 2
5657

5758

5859
def test_cli_capture_output():
@@ -160,7 +161,8 @@ def _update(*args, **kwargs):
160161
data={"return_code": return_code},
161162
)
162163

163-
assert update_mock.call_count == update_call_count
164+
if update_call_count:
165+
assert update_mock.call_count == update_call_count
164166
update_mock.assert_called_with(
165167
client=mock.ANY,
166168
organization_slug="org",

0 commit comments

Comments
 (0)