Skip to content

Commit

Permalink
Extend Gunicorn worker test wait times
Browse files Browse the repository at this point in the history
Some of the Gunicorn worker tests have been flaking occasionally with
timeouts, particularly `test_gunicorn_arbiter_signal_handling`. This
commit will extend the sleep and wait times so the tests will hopefully
flake less often.
  • Loading branch information
br3ndonland committed Jan 10, 2025
1 parent 1a2be82 commit 749a3eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_gunicorn_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def gunicorn_process(
process.output = output
yield process
process.send_signal(signal.SIGQUIT)
process.wait(timeout=2)
process.wait(timeout=5)


@pytest.fixture
Expand Down Expand Up @@ -265,7 +265,7 @@ def gunicorn_process_with_sigterm(
process.output = output
yield process
process.terminate()
process.wait(timeout=2)
process.wait(timeout=5)


@pytest.fixture
Expand Down Expand Up @@ -298,7 +298,7 @@ def gunicorn_process_with_lifespan_startup_failure(
process.output = output
yield process
process.terminate()
process.wait(timeout=2)
process.wait(timeout=5)


@pytest.mark.parametrize("signal_to_send", gunicorn_arbiter.Arbiter.SIGNALS)
Expand All @@ -316,7 +316,7 @@ def test_gunicorn_arbiter_signal_handling(
signal_abbreviation = gunicorn_arbiter.Arbiter.SIG_NAMES[signal_to_send]
expected_text = f"Handling signal: {signal_abbreviation}"
gunicorn_process.send_signal(signal_to_send)
time.sleep(1)
time.sleep(2)
output_text = gunicorn_process.read_output()
try:
assert expected_text in output_text
Expand All @@ -331,7 +331,7 @@ def test_gunicorn_arbiter_signal_handling(
getattr(signal, "SIGWINCH", None),
]
if signal_to_send not in flaky_signals:
time.sleep(2)
time.sleep(5)
output_text = gunicorn_process.read_output()
assert expected_text in output_text

Expand All @@ -354,7 +354,7 @@ def test_uvicorn_worker_boot_error(
[#1077]: https://github.com/encode/uvicorn/pull/1077
"""
output_text = gunicorn_process_with_lifespan_startup_failure.read_output()
gunicorn_process_with_lifespan_startup_failure.wait(timeout=2)
gunicorn_process_with_lifespan_startup_failure.wait(timeout=5)
assert gunicorn_process_with_lifespan_startup_failure.poll() is not None
assert "Worker failed to boot" in output_text

Expand Down

0 comments on commit 749a3eb

Please sign in to comment.