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

Flaky test: TestInitTtySizeErrors / TestRunAttachTermination #5254

Open
thaJeztah opened this issue Jul 17, 2024 · 3 comments
Open

Flaky test: TestInitTtySizeErrors / TestRunAttachTermination #5254

thaJeztah opened this issue Jul 17, 2024 · 3 comments

Comments

@thaJeztah
Copy link
Member

Description

Looks like this test has become flaky again, but .. different; e.g. seen failing on #5238

#20 60.67 === FAIL: cli/command/container TestInitTtySizeErrors (unknown)
#20 60.67 Error: write /dev/pts/0: file already closed
#20 60.67 panic: Fail in goroutine after TestRunAttachTermination has completed
#20 60.67 
#20 60.67 goroutine 216 [running]:
#20 60.67 testing.(*common).Fail(0xc00021eb60)
#20 60.67 	/usr/local/go/src/testing/testing.go:952 +0xd4
#20 60.67 testing.(*common).FailNow(0xc00021eb60)
#20 60.67 	/usr/local/go/src/testing/testing.go:975 +0x26
#20 60.67 github.com/docker/cli/vendor/gotest.tools/v3/assert.ErrorIs({0x1033010, 0xc00021eb60}, {0x102a300?, 0xc00049a0f0}, {0x102a3e0?, 0x16e0f30}, {0x0, 0x0, 0x0})
#20 60.67 	/go/src/github.com/docker/cli/vendor/gotest.tools/v3/assert/assert.go:311 +0x159
#20 60.67 github.com/docker/cli/cli/command/container.TestRunAttachTermination.func6()
#20 60.67 	/go/src/github.com/docker/cli/cli/command/container/run_test.go:85 +0x85
#20 60.67 created by github.com/docker/cli/cli/command/container.TestRunAttachTermination in goroutine 214
#20 60.67 	/go/src/github.com/docker/cli/cli/command/container/run_test.go:84 +0x486
@vvoland
Copy link
Collaborator

vvoland commented Jul 17, 2024

Looks like the main test goroutine exits before the child goroutine:

go func() {
assert.ErrorIs(t, cmd.ExecuteContext(ctx), context.Canceled)
}()

Also, the assert.ErrorIs should only be called in the main goroutine .

I gave it a quick try and synchronized this with a channel, see: c032138

Looks like the cmd.ExecuteContext doesn't return at all:

root@docker-cli-dev$ go test -run TestRunAttachTermination -v .
=== RUN   TestRunAttachTermination
    run_test.go:107: cmd.ExecuteContext was not finished before the 5 second timeout
--- FAIL: TestRunAttachTermination (5.01s)
FAIL
FAIL    github.com/docker/cli/cli/command/container     5.014s
FAIL

@Benehiko PTAL

@Benehiko
Copy link
Member

I'll take a look when I get the chance

@thaJeztah
Copy link
Member Author

59.68 === Failed
59.68 === FAIL: cli/command/container TestRunAttachTermination (unknown)
59.68 signal: interrupt
59.68 
59.68 DONE 2006 tests, 3 skipped, 1 failure in 59.329s

@thaJeztah thaJeztah changed the title Flaky test: TestInitTtySizeErrors Flaky test: TestInitTtySizeErrors / TestRunAttachTermination Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants