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)
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