Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix stuck streamer test....again #1197

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1197.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The stuck streamer test was updated to mitigate false failures potentially stemming from high load macOS GitHub runners.
14 changes: 7 additions & 7 deletions tests/integrations/subprocess/test_Subprocess__stream_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_stuck_streamer(mock_sub, streaming_process, monkeypatch, capsys):

def monkeypatched_blocked_streamer(*a, **kw):
"""Simulate a streamer that blocks longer than it will be waited on."""
if not monkeypatched_streamer_should_exit.wait(timeout=1):
if not monkeypatched_streamer_should_exit.wait(timeout=5):
monkeypatched_streamer_was_improperly_awaited.set()
monkeypatched_streamer_exited.set()

Expand All @@ -134,19 +134,19 @@ def monkeypatched_blocked_streamer(*a, **kw):

monkeypatched_streamer_should_exit.set()

# Since the waiting around for the output streamer has been
# short-circuited, Briefcase should quickly give up waiting on
# the output streamer and it should exit...so, confirm it does.
assert monkeypatched_streamer_exited.wait(timeout=1)
assert not monkeypatched_streamer_was_improperly_awaited.is_set()

# fmt: off
assert capsys.readouterr().out == (
"Stopping...\n"
"Log stream hasn't terminated; log output may be corrupted.\n"
)
# fmt: on

# Since the waiting around for the output streamer has been
# short-circuited, Briefcase should quickly give up waiting on
# the output streamer and it should exit...so, confirm it does.
assert monkeypatched_streamer_exited.wait(timeout=1)
assert not monkeypatched_streamer_was_improperly_awaited.is_set()


def test_stdout_closes_unexpectedly(mock_sub, streaming_process, monkeypatch, capsys):
"""Streamer exits from ValueError because stdout was closed."""
Expand Down