fix: Increase randomness for names used in tests (#3063)

We are starting to run into test flakes due to lack of randomness in CI,
this change simply bumps randomness by additional suffix numbers.

See: https://github.com/coder/coder/issues/3038#issuecomment-1190283608
This commit is contained in:
Mathias Fredriksson
2022-07-20 18:03:04 +03:00
committed by GitHub
parent 87b0b4b1ea
commit cd74afcccc

View File

@ -271,7 +271,7 @@ func CreateAnotherUser(t *testing.T, client *codersdk.Client, organizationID uui
func createAnotherUserRetry(t *testing.T, client *codersdk.Client, organizationID uuid.UUID, retries int, roles ...string) *codersdk.Client {
req := codersdk.CreateUserRequest{
Email: namesgenerator.GetRandomName(1) + "@coder.com",
Email: namesgenerator.GetRandomName(10) + "@coder.com",
Username: randomUsername(),
Password: "testpass",
OrganizationID: organizationID,
@ -677,7 +677,7 @@ func NewAzureInstanceIdentity(t *testing.T, instanceID string) (x509.VerifyOptio
}
func randomUsername() string {
return strings.ReplaceAll(namesgenerator.GetRandomName(0), "_", "-")
return strings.ReplaceAll(namesgenerator.GetRandomName(10), "_", "-")
}
// Used to easily create an HTTP transport!