Skip to content

Commit cd74afc

Browse files
authored
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: #3038 (comment)
1 parent 87b0b4b commit cd74afc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/coderdtest/coderdtest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func CreateAnotherUser(t *testing.T, client *codersdk.Client, organizationID uui
271271

272272
func createAnotherUserRetry(t *testing.T, client *codersdk.Client, organizationID uuid.UUID, retries int, roles ...string) *codersdk.Client {
273273
req := codersdk.CreateUserRequest{
274-
Email: namesgenerator.GetRandomName(1) + "@coder.com",
274+
Email: namesgenerator.GetRandomName(10) + "@coder.com",
275275
Username: randomUsername(),
276276
Password: "testpass",
277277
OrganizationID: organizationID,
@@ -677,7 +677,7 @@ func NewAzureInstanceIdentity(t *testing.T, instanceID string) (x509.VerifyOptio
677677
}
678678

679679
func randomUsername() string {
680-
return strings.ReplaceAll(namesgenerator.GetRandomName(0), "_", "-")
680+
return strings.ReplaceAll(namesgenerator.GetRandomName(10), "_", "-")
681681
}
682682

683683
// Used to easily create an HTTP transport!

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy