Skip to content

[27.1 backport] tests: fix flaxy TestCloseRunningCommand test#5293

Merged
thaJeztah merged 2 commits intodocker:27.0from
laurazard:27-backport-flaky-tests
Jul 24, 2024
Merged

[27.1 backport] tests: fix flaxy TestCloseRunningCommand test#5293
thaJeztah merged 2 commits intodocker:27.0from
laurazard:27-backport-flaky-tests

Conversation

@laurazard
Copy link
Copy Markdown
Member

backports #5290 and #5291

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 <laurabrehm@hey.com>
(cherry picked from commit cc68c66)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
Follow up to cc68c66 (there were more
tests with incorrect syntax).

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
(cherry picked from commit 4a7388f)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
@laurazard laurazard self-assigned this Jul 24, 2024
@thaJeztah thaJeztah added this to the 27.1.2 milestone Jul 24, 2024
@thaJeztah
Copy link
Copy Markdown
Member

LOL, and of course it fails on another flaky test? (TestRunAttachTermination)

ok  	github.com/docker/cli/cli/command/config	0.027s	coverage: 83.8% of statements
Error: something went wrong
Error: write /dev/ttys000: file already closed
panic: Fail in goroutine after TestRunAttachTermination has completed

goroutine 235 [running]:
testing.(*common).Fail(0xc0004ae4e0)
	/Users/runner/hostedtoolcache/go/1.21.12/x64/src/testing/testing.go:952 +0xd4
testing.(*common).FailNow(0xc0004ae4e0)
	/Users/runner/hostedtoolcache/go/1.21.12/x64/src/testing/testing.go:975 +0x26
github.com/docker/cli/vendor/gotest.tools/v3/assert.ErrorIs({0x1c49350, 0xc0004ae4e0}, {0x1c40480?, 0xc00054c000}, {0x1c40520?, 0x230e900}, {0x0, 0x0, 0x0})
	/Users/runner/work/cli/cli/src/github.com/docker/cli/vendor/gotest.tools/v3/assert/assert.go:311 +0x159
github.com/docker/cli/cli/command/container.TestRunAttachTermination.func6()
	/Users/runner/work/cli/cli/src/github.com/docker/cli/cli/command/container/run_test.go:85 +0x85
created by github.com/docker/cli/cli/command/container.TestRunAttachTermination in goroutine 233
	/Users/runner/work/cli/cli/src/github.com/docker/cli/cli/command/container/run_test.go:84 +0x486

@laurazard
Copy link
Copy Markdown
Member Author

That's another test I'm going to look at today 😅

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.50%. Comparing base (1b2782e) to head (7f02bc9).

Additional details and impacted files
@@           Coverage Diff           @@
##             27.0    #5293   +/-   ##
=======================================
  Coverage   61.50%   61.50%           
=======================================
  Files         299      299           
  Lines       20864    20864           
=======================================
  Hits        12832    12832           
  Misses       7116     7116           
  Partials      916      916           

@thaJeztah thaJeztah merged commit 2e506cb into docker:27.0 Jul 24, 2024
@thaJeztah thaJeztah changed the title [27.0 backport] tests: fix flaxy TestCloseRunningCommand test [27.1 backport] tests: fix flaxy TestCloseRunningCommand test Jul 24, 2024
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.

4 participants