Skip to content

flake: Test_sshConfigExecEscape #13962

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

Closed
matifali opened this issue Jul 20, 2024 · 4 comments · Fixed by #14233
Closed

flake: Test_sshConfigExecEscape #13962

matifali opened this issue Jul 20, 2024 · 4 comments · Fixed by #14233
Assignees
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks

Comments

@matifali
Copy link
Member

matifali commented Jul 20, 2024

flake: failed on main https://github.com/coder/coder/actions/runs/10017620244/job/27692037213#step:5:469

Seen 3 times in last 15 days.

Test execution: Test_sshConfigExecEscape

Error:


Failed

=== Failed
=== FAIL: cli Test_sshConfigExecEscape/spaces (0.01s)
    configssh_internal_test.go:182: 
        	Error Trace:	/home/runner/work/coder/coder/cli/configssh_internal_test.go:182
        	Error:      	Received unexpected error:
        	            	exit status 126
        	Test:       	Test_sshConfigExecEscape/spaces

=== FAIL: cli Test_sshConfigExecEscape (0.00s)
@matifali matifali added the flake label Jul 20, 2024
@coder-labeler coder-labeler bot added bug s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks labels Jul 20, 2024
@dannykopping
Copy link
Contributor

@mafredri
Copy link
Member

mafredri commented Aug 5, 2024

Exit code 126 indicates the user wan't allowed to execute (e.g. missing +x permission), however, os.WriteFile is called with 0o755 so that shouldn't be the case. The fact that such a simple test is flaking sporadically is really weird. It does feel like something else is the cause.

@ethanndickson
Copy link
Member

ethanndickson commented Aug 8, 2024

Removing the inner t.Parallel() fixes the flake for me. The output from the command says Text file busy, so the binary file (the script, in this case) it's having it's contents modified whilst being executed - very intriguing. I don't see any way that can happen outside of tmpDir path collisions, but that would not be an easily reproducible flake. I can only assume the WriteFile function is returning before the close syscall can finish, somehow??

Given we're not testing any code here that's concurrent, it might be worth just removing the parallel call to stop the flake?

@mafredri
Copy link
Member

mafredri commented Aug 9, 2024

Nice find @ethanndickson! The path collision is very mind boggling since it should be unique on both t.TempDir and tt.path. It’d be interesting to know the exact cause but just disabling parallel seems like the best option for now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants