Skip to content

Commit 9b7c40e

Browse files
committed
More fixes
1 parent bd87560 commit 9b7c40e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

coderd/coderdtest/coderdtest.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,18 +575,20 @@ func createAnotherUserRetry(t *testing.T, client *codersdk.Client, organizationI
575575
sessionToken = token.Key
576576
}
577577

578+
if user.Status == codersdk.UserStatusDormant {
579+
// Use admin client so that user's LastSeenAt is not updated.
580+
// In general we need to refresh the user status, which should
581+
// transition from "dormant" to "active".
582+
user, err = client.User(context.Background(), user.Username)
583+
require.NoError(t, err)
584+
}
585+
578586
other := codersdk.New(client.URL)
579587
other.SetSessionToken(sessionToken)
580588
t.Cleanup(func() {
581589
other.HTTPClient.CloseIdleConnections()
582590
})
583591

584-
if !req.DisableLogin && user.Status == codersdk.UserStatusDormant {
585-
// Refresh user account which should be active now.
586-
user, err = other.User(context.Background(), user.Username)
587-
require.NoError(t, err)
588-
}
589-
590592
if len(roles) > 0 {
591593
// Find the roles for the org vs the site wide roles
592594
orgRoles := make(map[string][]string)

0 commit comments

Comments
 (0)