Fix race in tty integration test with slow container startup#2186
Merged
crosbymichael merged 1 commit intoopencontainers:masterfrom Dec 26, 2019
Merged
Fix race in tty integration test with slow container startup#2186crosbymichael merged 1 commit intoopencontainers:masterfrom
crosbymichael merged 1 commit intoopencontainers:masterfrom
Conversation
Signed-off-by: Jordan Liggitt <liggitt@google.com>
Contributor
Author
|
looks like the travis job that is failing is also failing against master with the same error messages - https://travis-ci.org/opencontainers/runc/builds/626104372?utm_medium=notification&utm_source=github_status |
Member
|
#2175 tracks CI failure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a race condition in the tty
runc run [terminal=false]integration test (found while testing #2185).runc/tests/integration/tty.bats
Lines 203 to 209 in 7496a96
Currently, the test assumes that as soon as
runc statereturns information about the container, it is running andtestcontainer test_busybox runningshould succeed.When the container start is slow (because of load or synthetic delay), the
runc statecommand can return acreatedstate, allowingwait_for_containerto succeed, but letting thetestcontainer test_busybox runningcommand fail.This race can be demonstrated by synthetically slowing down the transition from created to running:
Without this change:
With this change:
$ make integration TESTPATH=/tty.bats ... ok 1 runc run [tty ptsname] ok 2 runc run [tty owner] ok 3 runc run [tty owner] ({u,g}id != 0) ok 4 runc exec [tty ptsname] ok 5 runc exec [tty owner] ok 6 runc exec [tty owner] ({u,g}id != 0) ok 7 runc exec [tty consolesize] ok 8 runc create [terminal=false] ok 9 runc run [terminal=false] ok 10 runc run -d [terminal=false]This PR allows providing a desired status to
wait_for_containerand additionally waiting untilrunc stateincludes that status.cc @mrunalp @Random-Liu