chore: fix flake in create-admin-user test#6103
Merged
deansheather merged 4 commits intomainfrom Feb 8, 2023
Merged
Conversation
mafredri
approved these changes
Feb 8, 2023
Member
There was a problem hiding this comment.
👍🏻
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).
mafredri
approved these changes
Feb 8, 2023
cli/server_createadminuser_test.go
Outdated
| // 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) |
Member
There was a problem hiding this comment.
Suggested change
| ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) | |
| ctx, cancel := context.WithTimeout(ctx, testutil.WaitSuperLong) |
Member
Author
There was a problem hiding this comment.
wait we have that? awesome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switches all of the tests to use ed25519 instead of all available key types to avoid needing a lot of randomness from the system.