Skip to content

Commit 8e64fb4

Browse files
committed
Wait for running server
1 parent af9eef5 commit 8e64fb4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/commercetools/contrib/pytest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import typing
33

44
import pytest
5+
import requests
56

67
from commercetools import Client
78
from commercetools.testing import backend_mocker
@@ -41,6 +42,12 @@ def serve():
4142
thread.start()
4243

4344
if is_running.wait():
45+
for i in range(0, 5):
46+
response = requests.get(server.api_url + "/-/health")
47+
if response.status_code == 200:
48+
break
49+
time.sleep(0.5)
50+
4451
yield server
4552

4653
thread.join(timeout=0)

0 commit comments

Comments
 (0)