Skip to content

Commit b9e6e63

Browse files
committed
fix: Increase randomness for names used in tests
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 f7ea016 commit b9e6e63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/coderdtest/coderdtest.go

+2-2
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)