Skip to content

Commit

Permalink
fix windows tests
Browse files Browse the repository at this point in the history
* different exit code on windows (not -9)
* `/bin/echo` obvs doesn't exist
  • Loading branch information
gjoseph92 committed Jun 15, 2022
1 parent d2f03e2 commit 9309c4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distributed/tests/test_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,15 +862,15 @@ def test_popen_timeout(capsys: pytest.CaptureFixture):
# The contextmanager raises `TimeoutExpired` once the process is killed,
# because it failed the 1s timeout
captured = capsys.readouterr()
assert "stdout: returncode -9" in captured.out
assert "stdout: returncode" in captured.out
assert "interrupted" in captured.out
assert "slept" in captured.out


def test_popen_always_prints_output(capsys: pytest.CaptureFixture):
# We always print stdout even if there was no error, in case some other assertion
# later in the test fails and the output would be useful.
with popen(["/bin/echo", "foo"], capture_output=True) as proc:
with popen([sys.executable, "-c", "print('foo')"], capture_output=True) as proc:
proc.communicate(timeout=5)

captured = capsys.readouterr()
Expand Down

0 comments on commit 9309c4f

Please sign in to comment.