Skip to content

Commit 05439d2

Browse files
authored
fix: generate username with uuid to prevent collision (#9496)
See https://github.com/coder/coder/actions/runs/6052801777/job/16426982174
1 parent 43ebf66 commit 05439d2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

enterprise/coderd/dormancy/dormantusersjob_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"time"
77

88
"github.com/google/uuid"
9-
"github.com/moby/moby/pkg/namesgenerator"
109
"github.com/stretchr/testify/require"
1110

1211
"cdr.dev/slog/sloggers/slogtest"
@@ -87,7 +86,7 @@ func TestCheckInactiveUsers(t *testing.T) {
8786
func setupUser(ctx context.Context, t *testing.T, db database.Store, email string, status database.UserStatus, lastSeenAt time.Time) database.User {
8887
t.Helper()
8988

90-
user, err := db.InsertUser(ctx, database.InsertUserParams{ID: uuid.New(), LoginType: database.LoginTypePassword, Username: namesgenerator.GetRandomName(8), Email: email})
89+
user, err := db.InsertUser(ctx, database.InsertUserParams{ID: uuid.New(), LoginType: database.LoginTypePassword, Username: uuid.NewString()[:8], Email: email})
9190
require.NoError(t, err)
9291
// At the beginning of the test all users are marked as active
9392
user, err = db.UpdateUserStatus(ctx, database.UpdateUserStatusParams{ID: user.ID, Status: status})

0 commit comments

Comments
 (0)