Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: fix flake in create-admin-user test #6103

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 4 commits into from
Feb 8, 2023

Conversation

deansheather
Copy link
Member

Switches all of the tests to use ed25519 instead of all available key types to avoid needing a lot of randomness from the system.

@deansheather deansheather requested a review from mafredri February 8, 2023 13:57
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

👍🏻

If you want even more control of the timeout, you could use pty.ExpectMatchContext() with a context of predetermined length (say 1 minute).

I suspect this would help since judging by the error in https://github.com/coder/coder/actions/runs/4112417865/jobs/7097301992, it looks like we encounter a expect match timeout, the test exits, and the cmd error is logged/flagged just as the test completes its teardown (between context cancel and postgres close).

@deansheather deansheather requested a review from mafredri February 8, 2023 14:05
// Sometimes generating SSH keys takes a really long time if there isn't
// enough entropy. We don't want the tests to fail in these cases.
//nolint:gocritic
ctx, cancel := context.WithTimeout(ctx, 1*time.Minute)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ctx, cancel := context.WithTimeout(ctx, 1*time.Minute)
ctx, cancel := context.WithTimeout(ctx, testutil.WaitSuperLong)

Copy link
Member Author

Choose a reason for hiding this comment

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

wait we have that? awesome

@deansheather deansheather enabled auto-merge (squash) February 8, 2023 14:13
@deansheather deansheather merged commit b5e5959 into main Feb 8, 2023
@deansheather deansheather deleted the dean/create-admin-user-flake branch February 8, 2023 15:36
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 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.

2 participants