Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIv2 tests: python something != something-podman #17204

Closed
edsantiago opened this issue Jan 24, 2023 · 1 comment · Fixed by #17215
Closed

APIv2 tests: python something != something-podman #17204

edsantiago opened this issue Jan 24, 2023 · 1 comment · Fixed by #17215
Assignees
Labels
flakes Flakes from Continuous Integration locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

Seeing this occasionally since Dec 30:

________________________ ContainerTestCase.test_attach _________________________
         
         self = <python.rest_api.test_v2_0_0_container.ContainerTestCase testMethod=test_attach>
         
             def test_attach(self):
                 r = requests.post(
                     self.podman_url + "/v1.40/containers/create?name=topcontainer",
                     json={"Cmd": ["sh", "-c", "echo podman; sleep 100"], "Image": "alpine:latest"},
                 )
                 self.assertEqual(r.status_code, 201, r.text)
                 payload = r.json()
             
                 r = requests.post(
                     self.podman_url
                     + f"/v1.40/containers/{payload['Id']}/start"
                 )
                 self.assertEqual(r.status_code, 204, r.text)
             
                 r = requests.post(
                     self.podman_url
                     + f"/v1.40/containers/{payload['Id']}/attach?logs=true&stream=false"
                 )
                 self.assertIn(r.status_code, (101, 200), r.text)
                 # see the attach format docs, stdout = 1, length = 7, message = podman\n
         >       self.assertEqual(r.content, b"\x01\x00\x00\x00\x00\x00\x00\x07podman\n", r.text)
         E       AssertionError: b'' != b'\x01\x00\x00\x00\x00\x00\x00\x07podman\n' :
         
         test/apiv2/python/rest_api/test_v2_0_0_container.py:155: AssertionError
         =========================== short test summary info ============================
         FAILED test/apiv2/python/rest_api/test_v2_0_0_container.py::ContainerTestCase::test_attach
         =================== 1 failed, 43 passed in 78.37s (0:01:18) ====================

If I read the URL correctly, this has something to do with logs, and ISTR other flakes in podman-remote logs but can't find the issue number.

@edsantiago edsantiago added the flakes Flakes from Continuous Integration label Jan 24, 2023
@Luap99
Copy link
Member

Luap99 commented Jan 24, 2023

This was added in 1424f09
Problem is that it needs a running container which already logged the message when it calls call attach to reproduce the bug. I assume that CI is just to slow so the message was not logged yet.

I will fix come up with a fix tomorrow.

@Luap99 Luap99 self-assigned this Jan 24, 2023
Luap99 added a commit to Luap99/libpod that referenced this issue Jan 25, 2023
The test was added in commit 1424f09, it can flake because the
attach test needs the message in the log. On slow CI systems this can
take longer. Add a retry logic which checks the container log every
second for up to 5 seconds. That should be plenty of time.

Fixes containers#17204

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flakes Flakes from Continuous Integration locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants