Skip to content

Commit

Permalink
Unquarantine background webserver test (apache#28249)
Browse files Browse the repository at this point in the history
The test was occasionally failing because gunicorn was not
immediately launched as subprocess.

This change adds extra attempts to wait for gunicorn process and
unquarantines it.
  • Loading branch information
potiuk authored Dec 9, 2022
1 parent aefa482 commit 5fad8a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/cli/commands/test_webserver_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ def _wait_pidfile(self, pidfile):
raise
time.sleep(1)

@pytest.mark.quarantined
def test_cli_webserver_background(self):
with tempfile.TemporaryDirectory(prefix="gunicorn") as tmpdir, mock.patch.dict(
"os.environ",
Expand Down Expand Up @@ -319,6 +318,11 @@ def test_cli_webserver_background(self):

# Assert that gunicorn and its monitor are launched.
assert 0 == subprocess.Popen(["pgrep", "-f", "-c", "airflow webserver --daemon"]).wait()
# wait for gunicorn to start
for i in range(30):
if 0 == subprocess.Popen(["pgrep", "-f", "-c", "^gunicorn"]).wait():
break
time.sleep(1)
assert 0 == subprocess.Popen(["pgrep", "-c", "-f", "gunicorn: master"]).wait()

# Terminate monitor process.
Expand Down

0 comments on commit 5fad8a4

Please sign in to comment.