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_env.py: add more attempts when executing ssh command #9015

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

matusmarhefka
Copy link
Member

Introduces more attempts when executing ssh command.
This should prevent race conditions when we try to connect
to a VM after a snapshot revert which might not be fully
finished, might help with
#8914

@matusmarhefka matusmarhefka added the Test Suite Update in Test Suite. label Jun 22, 2022
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Jun 22, 2022
@openshift-ci
Copy link

openshift-ci bot commented Jun 22, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Open in Gitpod

@matusmarhefka matusmarhefka changed the title [WIP] test_env.py: add more attempts when executing ssh command test_env.py: add more attempts when executing ssh command Jun 24, 2022
@matusmarhefka matusmarhefka marked this pull request as ready for review June 24, 2022 08:41
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Jun 24, 2022
@matejak matejak self-assigned this Jun 24, 2022
@matejak matejak added this to the 0.1.63 milestone Jun 24, 2022
Copy link
Member

@matejak matejak left a comment

Choose a reason for hiding this comment

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

I would prefer to have the "retry" capability in a separate function that could be used with run_with_stdout_logging whenever there is a need.

The interface of run_with_stdout_logging is standardized - things are good when result.returncode == 0, so the wrapper has the ability to know what's going on. As a result, the wrapper could either return the first result corresponding to the 0 return code, or it would return the last result obtained at the retry limit.

Such function would enable retry functionality for other use cases in the project.

@pep8speaks
Copy link

pep8speaks commented Jun 24, 2022

Hello @matusmarhefka! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-06-24 15:10:05 UTC

Introduces more attempts when executing ssh command.
This should prevent race conditions when we try to connect
to a VM after a snapshot revert which might not be fully
finished, might help with
ComplianceAsCode#8914
@codeclimate
Copy link

codeclimate bot commented Jun 24, 2022

Code Climate has analyzed commit 498c456 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 42.7% (0.0% change).

View more on Code Climate.

@matejak
Copy link
Member

matejak commented Jun 24, 2022

LGTM, Thank you for the PR!

@matejak matejak merged commit b74da48 into ComplianceAsCode:master Jun 24, 2022
@matusmarhefka matusmarhefka deleted the ssh_cmd_timeout branch June 27, 2022 08:13
@ggbecker
Copy link
Member

isn't this enough to close #8914 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Suite Update in Test Suite.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants