Skip to content

Fix flaky test case of TestExecInteractiveStdinClose#37076

Merged
vdemeester merged 1 commit intomoby:masterfrom
arm64b:TestExecInteractiveStdinClose
May 16, 2018
Merged

Fix flaky test case of TestExecInteractiveStdinClose#37076
vdemeester merged 1 commit intomoby:masterfrom
arm64b:TestExecInteractiveStdinClose

Conversation

@arm64b
Copy link
Copy Markdown
Contributor

@arm64b arm64b commented May 16, 2018

fixes #36877

This issue has been reported by issue #36877.

The purpose of this test case is for the regression test of #12546,
so we only need to make sure the essential of the testing is still
in the way to check that while not disturbed by some testing noises,
which is exactly what this PR want to do.

Signed-off-by: Dennis Chen [email protected]

- What I did

- How I did it

- How to verify it

- Description for the changelog

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

This issue has been reported by issue moby#36877.

The purpose of this test case is for the regression test of moby#12546,
so we only need to make sure the essential of the testing is still
in the way to check that while not disturbed by some testing noises,
which is exactly what this PR want to do.

Signed-off-by: Dennis Chen <[email protected]>
@arm64b
Copy link
Copy Markdown
Contributor Author

arm64b commented May 16, 2018

/cc @vdemeester @thaJeztah @anusha-ragunathan PTAL 😄

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2018

Codecov Report

Merging #37076 into master will decrease coverage by 0.25%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #37076      +/-   ##
==========================================
- Coverage   35.34%   35.09%   -0.26%     
==========================================
  Files         615      615              
  Lines       45818    45818              
==========================================
- Hits        16196    16080     -116     
- Misses      27470    27628     +158     
+ Partials     2152     2110      -42

@thaJeztah
Copy link
Copy Markdown
Member

Do we know what caused the test to fail in the first place?

@arm64b
Copy link
Copy Markdown
Contributor Author

arm64b commented May 16, 2018

Do we know what caused the test to fail in the first place?

It's hard to say as hard to reproduce, according to last experience, this kind of issue most probably is a synchronization issue, but since we have a 3rd party pty code, the pty.Start() is also a potential culprit.
Time consuming to narrow down the real cause, IMO we can focus on the test case itself if it can check the original regression or not?

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

yeah perhaps it's not worth looking into

LGTM

Copy link
Copy Markdown
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 😅

@vdemeester vdemeester merged commit b7b6b69 into moby:master May 16, 2018
@arm64b
Copy link
Copy Markdown
Contributor Author

arm64b commented May 16, 2018

Just take a look at the Start() method in vendor/github.com/kr/pty/run.go, seems it's the caller's responsibility to Close() the pty *os.File, so I guess the root cause maybe: we copy data from an opened file which will never be closed, from the file system perspective, this will probably result in data synchronization issue.

I suggest to add below code snippet in TestExecInteractiveStdinClose:

go func() {
  io.Copy(b, p)
  p.Close()
 } ()

Do we need to squash this change?

@vdemeester
Copy link
Copy Markdown
Member

@arm64b interesting… we should try that 👼 (in another PR, this one being merged already)

@anusha-ragunathan
Copy link
Copy Markdown
Contributor

+1 on trying #37076 (comment)

@thaJeztah
Copy link
Copy Markdown
Member

Follow-up done in #37086

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.

Flaky test: TestExecInteractiveStdinClose

5 participants