Skip to content

Commit ae17114

Browse files
committed
fix: Bump timeout even more, add individual timeout for assert
1 parent 4f7e32e commit ae17114

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

coderd/users_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ func TestPaginatedUsers(t *testing.T) {
10961096
coderdtest.CreateFirstUser(t, client)
10971097

10981098
// This test can take longer than a long time.
1099-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong*3)
1099+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong*4)
11001100
defer cancel()
11011101

11021102
me, err := client.User(ctx, codersdk.Me)
@@ -1105,7 +1105,7 @@ func TestPaginatedUsers(t *testing.T) {
11051105

11061106
// When 100 users exist
11071107
total := 100
1108-
allUsers := make([]codersdk.User, total+1)
1108+
allUsers := make([]codersdk.User, total+1) // +1 forme
11091109
allUsers[0] = me
11101110
specialUsers := make([]codersdk.User, total/2)
11111111

@@ -1180,6 +1180,10 @@ func TestPaginatedUsers(t *testing.T) {
11801180
func assertPagination(ctx context.Context, t *testing.T, client *codersdk.Client, limit int, allUsers []codersdk.User,
11811181
opt func(request codersdk.UsersRequest) codersdk.UsersRequest,
11821182
) {
1183+
// Ensure any single assertion doesn't take too long.s
1184+
ctx, cancel := context.WithTimeout(ctx, testutil.WaitLong)
1185+
defer cancel()
1186+
11831187
var count int
11841188
if opt == nil {
11851189
opt = func(request codersdk.UsersRequest) codersdk.UsersRequest {

0 commit comments

Comments
 (0)