Content-Length: 299339 | pFad | http://github.com/coder/coder/commit/bd3d0ea482aa67d7ea0740516a33640be0d2c74e

8E fix(agent/agentcontainers): fix `TestAPI/IgnoreCustomization` flake (… · coder/coder@bd3d0ea · GitHub
Skip to content

Commit bd3d0ea

Browse files
fix(agent/agentcontainers): fix TestAPI/IgnoreCustomization flake (#18863)
1 parent 87e5365 commit bd3d0ea

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

agent/agentcontainers/api_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,8 +2883,12 @@ func TestAPI(t *testing.T) {
28832883
Op: fsnotify.Write,
28842884
})
28852885

2886-
err = api.RefreshContainers(ctx)
2887-
require.NoError(t, err)
2886+
require.Eventuallyf(t, func() bool {
2887+
err = api.RefreshContainers(ctx)
2888+
require.NoError(t, err)
2889+
2890+
return len(fakeSAC.agents) == 1
2891+
}, testutil.WaitShort, testutil.IntervalFast, "subagent should be created after config change")
28882892

28892893
t.Log("Phase 2: Cont, waiting for sub agent to exit")
28902894
exitSubAgentOnce.Do(func() {
@@ -2919,8 +2923,12 @@ func TestAPI(t *testing.T) {
29192923
Op: fsnotify.Write,
29202924
})
29212925

2922-
err = api.RefreshContainers(ctx)
2923-
require.NoError(t, err)
2926+
require.Eventuallyf(t, func() bool {
2927+
err = api.RefreshContainers(ctx)
2928+
require.NoError(t, err)
2929+
2930+
return len(fakeSAC.agents) == 0
2931+
}, testutil.WaitShort, testutil.IntervalFast, "subagent should be deleted after config change")
29242932

29252933
req = httptest.NewRequest(http.MethodGet, "/", nil).WithContext(ctx)
29262934
rec = httptest.NewRecorder()

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/coder/coder/commit/bd3d0ea482aa67d7ea0740516a33640be0d2c74e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy