Skip to content

Commit 84881a0

Browse files
test: fix flaky tests (#16799)
Relates to: coder/internal#451 Create separate context with timeout for every subtest.
1 parent e9f8822 commit 84881a0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

coderd/database/querier_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -2169,9 +2169,6 @@ func TestExpectOne(t *testing.T) {
21692169
func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
21702170
t.Parallel()
21712171

2172-
now := dbtime.Now()
2173-
ctx := testutil.Context(t, testutil.WaitShort)
2174-
21752172
testCases := []struct {
21762173
name string
21772174
jobTags []database.StringMap
@@ -2393,6 +2390,8 @@ func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
23932390
t.Run(tc.name, func(t *testing.T) {
23942391
t.Parallel()
23952392
db, _ := dbtestutil.NewDB(t)
2393+
now := dbtime.Now()
2394+
ctx := testutil.Context(t, testutil.WaitShort)
23962395

23972396
// Create provisioner jobs based on provided tags:
23982397
allJobs := make([]database.ProvisionerJob, len(tc.jobTags))

0 commit comments

Comments
 (0)