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

flake: TestRealRunnerStdoutAndStderr* unit tests #5152

Closed
abayer opened this issue Jul 18, 2022 · 4 comments · Fixed by #5261
Closed

flake: TestRealRunnerStdoutAndStderr* unit tests #5152

abayer opened this issue Jul 18, 2022 · 4 comments · Fixed by #5261
Labels
kind/flake Categorizes issue or PR as related to a flakey test

Comments

@abayer
Copy link
Contributor

abayer commented Jul 18, 2022

I've seen a couple of these fail a few times recently on CI with this output:

=== RUN   TestRealRunnerStdoutAndStderrPaths
hello world
    runner_test.go:51: stderr: got: , wanted: hello world
--- FAIL: TestRealRunnerStdoutAndStderrPaths (0.02s)

...and...

=== RUN   TestRealRunnerStdoutAndStderrSamePath
    runner_test.go:78: got: 0, wanted: 24
--- FAIL: TestRealRunnerStdoutAndStderrSamePath (0.01s)

I have not been able to reproduce locally.

/kind flake

@tekton-robot tekton-robot added the kind/flake Categorizes issue or PR as related to a flakey test label Jul 18, 2022
@lbernick
Copy link
Member

Seeing this as well, I think it was added recently in #4882; @bradbeck would you mind taking a look at this? It might help to use a fake clock (example in taskrun reconciler tests) as opposed to a real one

@abayer
Copy link
Contributor Author

abayer commented Aug 2, 2022

From @dibyom on #5250

TestRealRunnerStdoutAndStderrPaths is testing out the expected stdout and stderr strings are written out to files. However, the writes happen asynchronously which means that sometimes the output that we get is empty leading to the test being flaky.

@dibyom
Copy link
Member

dibyom commented Aug 2, 2022

One fix might be to have the test wait in a loop till the file has content before comparing (with a time limit of a few seconds say)

@wlynch
Copy link
Member

wlynch commented Aug 2, 2022

Took a crack at this in #5261 since this blocked one of my other PRs 🙃 - would appreciate any feedback, in particular since this is going against what a comment in the original PR said not to do (but I think it's fine anyway?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/flake Categorizes issue or PR as related to a flakey test
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants