mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
test: fix flaky tests (#16799)
Relates to: https://github.com/coder/internal/issues/451 Create separate context with timeout for every subtest.
This commit is contained in:
committed by
GitHub
parent
e9f882220e
commit
84881a0e98
@ -2169,9 +2169,6 @@ func TestExpectOne(t *testing.T) {
|
||||
func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
now := dbtime.Now()
|
||||
ctx := testutil.Context(t, testutil.WaitShort)
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
jobTags []database.StringMap
|
||||
@ -2393,6 +2390,8 @@ func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
db, _ := dbtestutil.NewDB(t)
|
||||
now := dbtime.Now()
|
||||
ctx := testutil.Context(t, testutil.WaitShort)
|
||||
|
||||
// Create provisioner jobs based on provided tags:
|
||||
allJobs := make([]database.ProvisionerJob, len(tc.jobTags))
|
||||
|
Reference in New Issue
Block a user