Skip to content

fix: test: TestSSH_RemoteForward: wait for startup script #10211

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

Merged
merged 1 commit into from
Oct 11, 2023
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Oct 11, 2023

Fixes: #10204

Seen: https://github.com/coder/coder/actions/runs/6468296837/job/17560058112?pr=10164

This test improvement introduces an extra step to wait for the startup script execution, so in theory it reduces the total waiting time.

I don't have a bulletproof solution, but it should reduce flakiness. In theory, we should wait for the $ char, but it can be different based on the system environment. In my case, it is ~. I considered setting it through PS1, but I'm afraid that we need to overwrite .bashrc.

@mtojek mtojek requested a review from spikecurtis October 11, 2023 10:42
@mtojek mtojek self-assigned this Oct 11, 2023
@mtojek mtojek changed the title fix: TestSSH_RemoteForward: wait for startup script fix: test: TestSSH_RemoteForward: wait for startup script Oct 11, 2023
@spikecurtis
Copy link
Contributor

In theory, we should wait for the $ char, but it can be different based on the system environment. In my case, it is ~. I considered setting it through PS1, but I'm afraid that we need to overwrite .bashrc.

I ran into the same issue with ReconnectingPTY tests.

#9882

If you start bash --norc on the remote, you'll get a nice, predictable shell that you can match, even if the user has customized their prompt in .bashrc

@mtojek
Copy link
Member Author

mtojek commented Oct 11, 2023

@spikecurtis In ReconnectingPTY you operate on the lower level, and control the process under-the-hood (bash --norc). I don't see this opportunity in this case, but maybe my knowledge is insufficient here.

@mtojek mtojek marked this pull request as ready for review October 11, 2023 11:15
@spikecurtis
Copy link
Contributor

Hmm, I'd have expected coder ssh to accept a command the way ssh does, but apparently not. Out of scope to fix that right now....

Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

LGTM

@mtojek mtojek merged commit a1ee4d4 into main Oct 11, 2023
@mtojek mtojek deleted the 10204-testssh branch October 11, 2023 12:17
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test flake: cli TestSSH/RemoteForward
2 participants