Skip to content

Commit 996c9b5

Browse files
authored
Merge branch 'main' into mafredri/test-fix-agent-wait
2 parents bcfa19e + 6f06f8d commit 996c9b5

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

coderd/workspaceapps/apptest/apptest.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func Run(t *testing.T, factory DeploymentFactory) {
4747
t.Skip("ConPTY appears to be inconsistent on Windows.")
4848
}
4949

50-
expectLine := func(r *bufio.Reader, matcher func(string) bool) {
50+
expectLine := func(t *testing.T, r *bufio.Reader, matcher func(string) bool) {
5151
for {
5252
line, err := r.ReadString('\n')
5353
require.NoError(t, err)
@@ -98,8 +98,8 @@ func Run(t *testing.T, factory DeploymentFactory) {
9898
_, err = conn.Write(data)
9999
require.NoError(t, err)
100100

101-
expectLine(bufRead, matchEchoCommand)
102-
expectLine(bufRead, matchEchoOutput)
101+
expectLine(t, bufRead, matchEchoCommand)
102+
expectLine(t, bufRead, matchEchoOutput)
103103
})
104104

105105
t.Run("SignedTokenQueryParameter", func(t *testing.T) {
@@ -148,7 +148,7 @@ func Run(t *testing.T, factory DeploymentFactory) {
148148
conn := websocket.NetConn(ctx, wsConn, websocket.MessageBinary)
149149
bufRead := bufio.NewReader(conn)
150150

151-
expectLine(bufRead, matchEchoOutput)
151+
expectLine(t, bufRead, matchEchoOutput)
152152
})
153153
})
154154

coderd/workspacebuilds_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,7 @@ func TestWorkspaceBuildState(t *testing.T) {
572572

573573
func TestWorkspaceBuildStatus(t *testing.T) {
574574
t.Parallel()
575-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
576-
defer cancel()
575+
577576
auditor := audit.NewMock()
578577
numLogs := len(auditor.AuditLogs())
579578
client, closeDaemon, api := coderdtest.NewWithAPI(t, &coderdtest.Options{IncludeProvisionerDaemon: true, Auditor: auditor})
@@ -597,6 +596,10 @@ func TestWorkspaceBuildStatus(t *testing.T) {
597596
closeDaemon = coderdtest.NewProvisionerDaemon(t, api)
598597
// after successful build is "running"
599598
_ = coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
599+
600+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
601+
defer cancel()
602+
600603
workspace, err := client.Workspace(ctx, workspace.ID)
601604
require.NoError(t, err)
602605
require.EqualValues(t, codersdk.WorkspaceStatusRunning, workspace.LatestBuild.Status)

enterprise/coderd/templates_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,6 @@ func TestReadFileWithTemplateUpdate(t *testing.T) {
980980
t.Parallel()
981981
t.Run("HasTemplateUpdate", func(t *testing.T) {
982982
t.Parallel()
983-
ctx := testutil.Context(t, testutil.WaitMedium)
984983

985984
// Upload a file
986985
client := coderdenttest.New(t, nil)
@@ -991,6 +990,8 @@ func TestReadFileWithTemplateUpdate(t *testing.T) {
991990
},
992991
})
993992

993+
ctx := testutil.Context(t, testutil.WaitLong)
994+
994995
resp, err := client.Upload(ctx, codersdk.ContentTypeTar, bytes.NewReader(make([]byte, 1024)))
995996
require.NoError(t, err)
996997

0 commit comments

Comments
 (0)