Skip to content

Commit c17a577

Browse files
committed
fix: Commit rest of the modified files
1 parent 579a96b commit c17a577

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

coderd/coderdtest/coderdtest.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import (
5252
"github.com/coder/coder/coderd/util/ptr"
5353
"github.com/coder/coder/codersdk"
5454
"github.com/coder/coder/cryptorand"
55+
"github.com/coder/coder/internal/testutil"
5556
"github.com/coder/coder/provisioner/echo"
5657
"github.com/coder/coder/provisionerd"
5758
"github.com/coder/coder/provisionersdk"
@@ -179,7 +180,7 @@ func newWithCloser(t *testing.T, options *Options) (*codersdk.Client, io.Closer)
179180
AgentConnectionUpdateFrequency: 150 * time.Millisecond,
180181
// Force a long disconnection timeout to ensure
181182
// agents are not marked as disconnected during slow tests.
182-
AgentInactiveDisconnectTimeout: 5 * time.Second,
183+
AgentInactiveDisconnectTimeout: testutil.WaitShort,
183184
AccessURL: serverURL,
184185
Logger: slogtest.Make(t, nil).Leveled(slog.LevelDebug),
185186
CacheDir: t.TempDir(),
@@ -412,7 +413,7 @@ func AwaitTemplateVersionJob(t *testing.T, client *codersdk.Client, version uuid
412413
var err error
413414
templateVersion, err = client.TemplateVersion(context.Background(), version)
414415
return assert.NoError(t, err) && templateVersion.Job.CompletedAt != nil
415-
}, 5*time.Second, 25*time.Millisecond)
416+
}, testutil.WaitShort, testutil.IntervalFast)
416417
return templateVersion
417418
}
418419

@@ -426,7 +427,7 @@ func AwaitWorkspaceBuildJob(t *testing.T, client *codersdk.Client, build uuid.UU
426427
var err error
427428
workspaceBuild, err = client.WorkspaceBuild(context.Background(), build)
428429
return assert.NoError(t, err) && workspaceBuild.Job.CompletedAt != nil
429-
}, 5*time.Second, 25*time.Millisecond)
430+
}, testutil.WaitShort, testutil.IntervalFast)
430431
return workspaceBuild
431432
}
432433

@@ -450,7 +451,7 @@ func AwaitWorkspaceAgents(t *testing.T, client *codersdk.Client, build uuid.UUID
450451
}
451452
}
452453
return true
453-
}, 15*time.Second, 50*time.Millisecond)
454+
}, testutil.WaitLong, testutil.IntervalMedium)
454455
return resources
455456
}
456457

pty/ptytest/ptytest.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/stretchr/testify/require"
1717
"golang.org/x/xerrors"
1818

19+
"github.com/coder/coder/internal/testutil"
1920
"github.com/coder/coder/pty"
2021
)
2122

@@ -85,7 +86,7 @@ type PTY struct {
8586
func (p *PTY) ExpectMatch(str string) string {
8687
p.t.Helper()
8788

88-
timeout, cancel := context.WithTimeout(context.Background(), 10*time.Second)
89+
timeout, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
8990
defer cancel()
9091

9192
var buffer bytes.Buffer

0 commit comments

Comments
 (0)