Skip to content

Commit 2391e3f

Browse files
committed
[NETPATH-1108] Fix RC setup ordering in dynamic path E2E
1 parent d4cd6c3 commit 2391e3f

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

test/new-e2e/tests/netpath/dynamic-tests/host_traffic_dynamic_path_test.go

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -158,26 +158,18 @@ func (s *hostTrafficDynamicPathSuite) SetupSuite() {
158158
s.BaseSuite.SetupSuite()
159159
defer s.CleanupOnSetupFailure()
160160

161+
// Add the config before the rest of setup. Fakeintake returns 404 when the
162+
// Agent polls an empty RC repository, and those responses increase the
163+
// Agent's retry backoff while the host dependencies are being prepared.
164+
fakeintake := s.Env().FakeIntake.Client()
165+
require.NoError(s.T(), fakeintake.RCAddConfig("", hostTrafficRCProduct, hostTrafficRCConfigID, hostTrafficRCConfigName, hostTrafficDynamicRCConfig))
166+
s.remoteConfigAdded = true
167+
161168
s.ensureCurlInstalled()
162169
s.startHostTrafficDNSServer()
163170
s.configureAgentResolver()
164171
s.assertHostTrafficDomainResolves()
165172

166-
fakeintake := s.Env().FakeIntake.Client()
167-
s.EventuallyWithT(func(c *assert.CollectT) {
168-
stats, err := fakeintake.RCStats()
169-
assert.NoError(c, err)
170-
assert.NotZero(c, stats.Polls, "agent did not poll fakeintake Remote Config")
171-
}, 2*time.Minute, 5*time.Second)
172-
require.NoError(s.T(), fakeintake.RCAddConfig("", hostTrafficRCProduct, hostTrafficRCConfigID, hostTrafficRCConfigName, hostTrafficDynamicRCConfig))
173-
s.remoteConfigAdded = true
174-
175-
// We deliberately don't gate setup on the agent re-polling Remote Config here.
176-
// The agent's RC refresh cadence is defaultRefreshInterval (1m) plus exponential
177-
// backoff on transient errors, so the next poll can legitimately land beyond a
178-
// short deadline and would flake this gate. TestHostTrafficDynamicNetworkPath
179-
// already waits for the RC-admitted network path to appear, which inherently
180-
// proves the agent polled and applied this config.
181173
require.NoError(s.T(), fakeintake.FlushServerAndResetAggregators())
182174
}
183175

@@ -199,7 +191,9 @@ func (s *hostTrafficDynamicPathSuite) AfterTest(suiteName, testName string) {
199191

200192
func (s *hostTrafficDynamicPathSuite) TestHostTrafficDynamicNetworkPath() {
201193
fakeintake := s.Env().FakeIntake.Client()
202-
s.startHostTrafficGenerator(4 * time.Minute)
194+
// Keep producing matching connections for longer than the assertion window
195+
// so a delayed RC application still has traffic to admit.
196+
s.startHostTrafficGenerator(6 * time.Minute)
203197

204198
var remoteConfigMatch *aggregator.Netpath
205199
s.EventuallyWithT(func(c *assert.CollectT) {

0 commit comments

Comments
 (0)