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

Fix flaky TestCloseRunningCommand test #5290

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

laurazard
Copy link
Member

@laurazard laurazard commented Jul 24, 2024

- What I did

Fixed flaky TestCloseRunningCommand test.

- How I did it

Looks like this test was failing due to bad syntax on the while loop, which caused it to die after 1 second. If the test took a bit longer, the process would be dead before the following assertions run, causing the test to fail/be flaky.

- How to verify it

Run the test!

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Looks like this test was failing due to bad syntax on the `while` loop,
which caused it to die after 1 second. If the test took a bit longer,
the process would be dead before the following assertions run, causing
the test to fail/be flaky.

Signed-off-by: Laura Brehm <[email protected]>
@laurazard laurazard self-assigned this Jul 24, 2024
@laurazard laurazard requested a review from thaJeztah July 24, 2024 09:36
@laurazard laurazard assigned Benehiko and vvoland and unassigned vvoland and Benehiko Jul 24, 2024
@laurazard laurazard requested review from vvoland and Benehiko July 24, 2024 09:37
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.44%. Comparing base (482bf86) to head (cc68c66).
Report is 244 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5290      +/-   ##
==========================================
+ Coverage   61.38%   61.44%   +0.05%     
==========================================
  Files         298      299       +1     
  Lines       20722    20854     +132     
==========================================
+ Hits        12720    12813      +93     
- Misses       7102     7125      +23     
- Partials      900      916      +16     

@laurazard laurazard merged commit 1055536 into docker:master Jul 24, 2024
101 checks passed
@laurazard laurazard deleted the fix-flaxy-connhelper-test branch July 24, 2024 10:03
@thaJeztah
Copy link
Member

Looks like there's more!

git grep 'while true; sleep 1;'
cli/connhelper/commandconn/commandconn_unix_test.go:    c, err := New(ctx, "sh", "-c", "while true; sleep 1; done")
cli/connhelper/commandconn/commandconn_unix_test.go:    c, err := New(ctx, "sh", "-c", "while true; sleep 1; done")

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

Successfully merging this pull request may close these issues.

5 participants