Skip to content

Commit

Permalink
Merge pull request #17215 from Luap99/attach-flake
Browse files Browse the repository at this point in the history
fix APIv2 python attach test flake
  • Loading branch information
openshift-merge-robot authored Jan 25, 2023
2 parents c35e74f + 9904fbe commit 64ea213
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/apiv2/python/rest_api/test_v2_0_0_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,19 @@ def test_attach(self):
)
self.assertEqual(r.status_code, 204, r.text)

# wait for the log message to appear to avoid flakes on slow systems
# with the /attach?logs=true test below
for _ in range(5):
r = requests.get(
self.podman_url
+ f"/v1.40/containers/{payload['Id']}/logs?stdout=true"
)
self.assertIn(r.status_code, (101, 200), r.text)
if r.content == b"\x01\x00\x00\x00\x00\x00\x00\x07podman\n":
break

time.sleep(1)

r = requests.post(
self.podman_url
+ f"/v1.40/containers/{payload['Id']}/attach?logs=true&stream=false"
Expand Down

0 comments on commit 64ea213

Please sign in to comment.