mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
fix(agent/agentcontainers): fix TestAPI/IgnoreCustomization flake (#18863)
This commit is contained in:
@@ -2883,8 +2883,12 @@ func TestAPI(t *testing.T) {
|
||||
Op: fsnotify.Write,
|
||||
})
|
||||
|
||||
err = api.RefreshContainers(ctx)
|
||||
require.NoError(t, err)
|
||||
require.Eventuallyf(t, func() bool {
|
||||
err = api.RefreshContainers(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
return len(fakeSAC.agents) == 1
|
||||
}, testutil.WaitShort, testutil.IntervalFast, "subagent should be created after config change")
|
||||
|
||||
t.Log("Phase 2: Cont, waiting for sub agent to exit")
|
||||
exitSubAgentOnce.Do(func() {
|
||||
@@ -2919,8 +2923,12 @@ func TestAPI(t *testing.T) {
|
||||
Op: fsnotify.Write,
|
||||
})
|
||||
|
||||
err = api.RefreshContainers(ctx)
|
||||
require.NoError(t, err)
|
||||
require.Eventuallyf(t, func() bool {
|
||||
err = api.RefreshContainers(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
return len(fakeSAC.agents) == 0
|
||||
}, testutil.WaitShort, testutil.IntervalFast, "subagent should be deleted after config change")
|
||||
|
||||
req = httptest.NewRequest(http.MethodGet, "/", nil).WithContext(ctx)
|
||||
rec = httptest.NewRecorder()
|
||||
|
||||
Reference in New Issue
Block a user