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

test/system: fix wait_for_port() to wait for bind #17707

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Mar 7, 2023

The goal of the wait_for_port() function is to return when the port is bound. This is to make sure we wait for application startup time. This can be seen in some comments of the callers.

Commit 7e3d04f caused this regression while reworking the logic to read ports from /proc. I doesn't seem to cause problems in CI, properly because the function returns before the port is bound. I have not seen any flakes related to this but I only see the ones on PRs where I rerun tests so it is best to wait for Ed to take a look.

Also fixes the broken ipv4_to_procfs() which only passes one argument to
__ipv4_to_procfs(), this results in the ipv4 not beeing inverted.
Therefore all bind checks against a direct ipv4 did not work.
This function accepts only an ipv4 but one caller passes localhost
which is invalid.

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 7, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 7, 2023
@Luap99
Copy link
Member Author

Luap99 commented Mar 7, 2023

/hold lets wait for @edsantiago to confirm this change when he is back

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 7, 2023
@Luap99 Luap99 marked this pull request as ready for review March 13, 2023 14:52
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 13, 2023
@edsantiago
Copy link
Member

Well... I've never seen a flake in the tests that use wait_for_port; and now all of system tests are failing in exactly those tests; so I'm guessing that this needs further thought...

@Luap99
Copy link
Member Author

Luap99 commented Mar 13, 2023

Found the problem, ipv4_to_procfs() did not work. It converted the ip incorrectly thus the check was not finding a match.

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. LGTM with one request.

test/system/251-system-service.bats Outdated Show resolved Hide resolved
The goal of the wait_for_port() function is to return when the port is
bound. This is to make sure we wait for application startup time.
This can be seen in some comments of the callers.

Commit 7e3d04f caused this regression while reworking the logic to read
ports from /proc. I doesn't seem to cause problems in CI, properly
because the function returns before the port is bound.
I have not seen any flakes related to this but I only see the ones on
PRs where I rerun tests so it is best to wait for Ed to take a look.

Also fixes the broken ipv4_to_procfs() which only passes one argument to
__ipv4_to_procfs(), this results in the ipv4 not beeing inverted.
Therefore all bind checks against a direct ipv4 did not work.
This function accepts only an ipv4 but one caller passes localhost
which is invalid.

Signed-off-by: Paul Holzinger <[email protected]>
@edsantiago
Copy link
Member

Thank you!

/lgtm
/hold

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 14, 2023
@Luap99
Copy link
Member Author

Luap99 commented Mar 14, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2023
@openshift-merge-robot openshift-merge-robot merged commit 998acd7 into containers:main Mar 14, 2023
@Luap99 Luap99 deleted the wait-for-port branch March 14, 2023 16:38
@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 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants