Skip to content

Commit 3c319fc

Browse files
committed
chore(cli): fix test flake caused by agent connect race
1 parent 81ef9e9 commit 3c319fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cli/exp_rpty_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ func TestExpRpty(t *testing.T) {
8787
require.NoError(t, err, "Could not stop container")
8888
})
8989

90+
_ = agenttest.New(t, client.URL, agentToken, func(o *agent.Options) {
91+
o.ExperimentalContainersEnabled = true
92+
})
93+
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
94+
9095
inv, root := clitest.New(t, "exp", "rpty", workspace.Name, "-c", ct.Container.ID)
9196
clitest.SetupConfig(t, client, root)
9297
pty := ptytest.New(t).Attach(inv)
@@ -96,11 +101,6 @@ func TestExpRpty(t *testing.T) {
96101
assert.NoError(t, err)
97102
})
98103

99-
_ = agenttest.New(t, client.URL, agentToken, func(o *agent.Options) {
100-
o.ExperimentalContainersEnabled = true
101-
})
102-
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
103-
104104
pty.ExpectMatch(fmt.Sprintf("Connected to %s", workspace.Name))
105105
pty.ExpectMatch("Reconnect ID: ")
106106
pty.ExpectMatch(" #")

0 commit comments

Comments
 (0)