Skip to content

Commit 545cb9a

Browse files
authored
fix: wait for coordinator in Test_agentIsLegacy (#11214)
Fixes flake https://github.com/coder/coder/runs/19639217635 AGPL coordinator used to process node updates for single_tailnet synchronously, but it's been refactored to process async, so in this test we need to wait for it to be processed.
1 parent e6e65fd commit 545cb9a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

enterprise/coderd/workspaceproxycoordinator_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ func Test_agentIsLegacy(t *testing.T) {
7575
AllowedIPs: []netip.Prefix{netip.PrefixFrom(codersdk.WorkspaceAgentIP, 128)},
7676
Endpoints: []string{"192.168.1.1:18842"},
7777
}))
78+
require.Eventually(t, func() bool {
79+
return coordinator.Node(nodeID) != nil
80+
}, testutil.WaitShort, testutil.IntervalFast)
7881

7982
proxyRes, err := client.CreateWorkspaceProxy(ctx, codersdk.CreateWorkspaceProxyRequest{
8083
Name: namesgenerator.GetRandomName(1),
@@ -139,6 +142,9 @@ func Test_agentIsLegacy(t *testing.T) {
139142
AllowedIPs: []netip.Prefix{netip.PrefixFrom(agpl.IPFromUUID(nodeID), 128)},
140143
Endpoints: []string{"192.168.1.1:18842"},
141144
}))
145+
require.Eventually(t, func() bool {
146+
return coordinator.Node(nodeID) != nil
147+
}, testutil.WaitShort, testutil.IntervalFast)
142148

143149
proxyRes, err := client.CreateWorkspaceProxy(ctx, codersdk.CreateWorkspaceProxyRequest{
144150
Name: namesgenerator.GetRandomName(1),

0 commit comments

Comments
 (0)