Skip to content

Commit

Permalink
🐛 Fix testing race condition by sending the request first (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo authored Apr 27, 2020
1 parent e8bb417 commit 5025fde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_01_main/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@


def verify_container(container: DockerClient, response_text: str) -> None:
response = requests.get("http://127.0.0.1:8000")
data = response.json()
assert data["message"] == response_text
config_data = get_config(container)
assert config_data["workers_per_core"] == 1
assert config_data["use_max_workers"] is None
Expand All @@ -30,9 +33,6 @@ def verify_container(container: DockerClient, response_text: str) -> None:
assert config_data["keepalive"] == 5
assert config_data["errorlog"] == "-"
assert config_data["accesslog"] == "-"
response = requests.get("http://127.0.0.1:8000")
data = response.json()
assert data["message"] == response_text
logs = get_logs(container)
assert "Checking for script in /app/prestart.sh" in logs
assert "Running script /app/prestart.sh" in logs
Expand Down

0 comments on commit 5025fde

Please sign in to comment.