Skip to content

Commit 3bd32a2

Browse files
authored
chore(cli): wait for agent to connect before dialing it in TestExpRpty (#17026)
Fixes flake seen here: https://github.com/coder/coder/actions/runs/13970861685/job/39113344525
1 parent 72d9876 commit 3bd32a2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cli/exp_rpty_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ func TestExpRpty(t *testing.T) {
3333

3434
ctx := testutil.Context(t, testutil.WaitLong)
3535

36+
_ = agenttest.New(t, client.URL, agentToken)
37+
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
38+
3639
cmdDone := tGo(t, func() {
3740
err := inv.WithContext(ctx).Run()
3841
assert.NoError(t, err)
3942
})
4043

41-
_ = agenttest.New(t, client.URL, agentToken)
42-
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
43-
4444
pty.WriteLine("exit")
4545
<-cmdDone
4646
})
@@ -56,14 +56,14 @@ func TestExpRpty(t *testing.T) {
5656

5757
ctx := testutil.Context(t, testutil.WaitLong)
5858

59+
_ = agenttest.New(t, client.URL, agentToken)
60+
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
61+
5962
cmdDone := tGo(t, func() {
6063
err := inv.WithContext(ctx).Run()
6164
assert.NoError(t, err)
6265
})
6366

64-
_ = agenttest.New(t, client.URL, agentToken)
65-
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
66-
6767
pty.ExpectMatch(randStr)
6868
<-cmdDone
6969
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy