Repository navigation
[bp/1.40] Test deflakes and optimisations - #49200
Merged
Merged
Conversation
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#48439) ## Description This PR fixes a flaky test in the DYM for Cert Selector. --- **Commit Message:** dynamic_modules: join async host selection threads in cluster tests **Risk Level:** Low **Testing:** CI **Docs Changes**: N/A **Release Notes**: N/A Signed-off-by: Rohit Agrawal <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
In `HttpInspectorTest`, `io_handle_` is instantiated with fake socket fd 42. Because `os_sys_calls_.close()` was not mocked, destroying `io_handle_` invoked `::close(42)` on the OS. If another thread opened or was using fd 42 (e.g. an internal eventfd or pipe), closing it caused a TSAN data race on fd 42. Mock `close()` to return success without closing the descriptor, matching `TlsInspectorTest` and `TlsInspectorJa4Test`. Risk Level: Low (test-only) Testing: `//test/extensions/filters/listener/http_inspector:http_inspector_test` under TSAN (100 runs) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: antoniovleonti <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
In `ServerInstanceImplTest.RtdsOverAdsShutdown`, `server_->run()` executes on `server_thread` while `server_->shutdown()` was called directly from the main test thread. This caused a TSAN data race against `isShutdown()` in `InstanceBase::startWorkers()`. Post the shutdown call to the server's dispatcher instead, matching how other tests in `server_test` trigger shutdown when using `startTestServer()`. Risk Level: Low (test-only) Testing: `//test/server:server_test` under TSAN (100 runs) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: antoniovleonti <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
Null-guard `TimedCertValidator::validationPending()` and add a callback when cert validation starts so `QuicHttpIntegrationTest` only lowers the QUIC handshake timeout once `doVerifyCertChain()` is reached. Also allow updating the validation timeout directly on `TimedCertValidator` so tests can immediately expire the pending timer after disconnect/teardown instead of busy-waiting. Risk Level: low; test only Testing: CI, local testing AI was used in debugging and authoring this PR. Signed-off-by: Alejandro R. Sedeño <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
…#48766) Signed-off-by: Ryan Northey <[email protected]>
phlax
marked this pull request as ready for review
November 12, 2026 08:31
phlax
requested review from
agrawroh,
botengyao,
kyessenov,
mathetake,
mattklein123,
tonya11en,
tyxia,
wbpcode,
yanavlasov and
yanjunxiang-google
as code owners
November 12, 2026 08:31
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Two integration tests can connect before the listener accepts connections because the readiness wait returns prematurely, risking timeouts unless they also wait for the workers-started gauge.
1 open issue
What changed in this PR
Backports test reliability fixes and runtime optimizations from main to release/v1.40, without changing product code.
Changes:
- Fix startup, shutdown, connection-cleanup, and asynchronous callback races.
- Replace timing assumptions with explicit synchronization and shorten unnecessary test waits.
- Adjust test sharding, resource allocation, and MemorySanitizer timeouts.
| File | Description |
|---|---|
test/server/server_test.cc |
Post shutdown to the server dispatcher. |
test/integration/xfcc_integration_test.cc |
Synchronize workers before checking generated stats. |
test/integration/xds_integration_test.cc |
Close clients locally after close-marked responses. |
test/integration/shadow_policy_integration_test.cc |
Use default counter-wait timeouts. |
test/integration/quic_http_integration_test.cc |
Coordinate handshake failure with pending certificate validation. |
test/integration/protocol_integration_test.cc |
Shorten timers, synchronize histogram samples, and reduce header payloads. |
test/integration/network_extension_discovery_integration_test.cc |
Add readiness waits before client connections. |
test/integration/http2_flood_integration_test.cc |
Isolate flush timeouts and wait for buffered response bytes. |
test/integration/drain_close_integration_test.cc |
Shorten the fixture’s drain timeout. |
test/integration/BUILD |
Adjust test sizes, QUIC sharding, and dependencies. |
test/extensions/transport_sockets/tls/cert_selectors/on_demand/integration_test.cc |
Wait for active certificate tracking before interrupting the handshake. |
test/extensions/filters/network/ext_proc/ext_proc_integration_test.cc |
Wait for connection-close events instead of immediate write failures. |
test/extensions/filters/listener/http_inspector/http_inspector_test.cc |
Mock closing the fake socket descriptor. |
test/extensions/filters/http/ratelimit/ratelimit_integration_test.cc |
Wait for ratelimit connection disconnection during cleanup. |
test/extensions/filters/http/on_demand/on_demand_integration_test.cc |
Serve RDS and VHDS before waiting for listener readiness. |
test/extensions/filters/http/on_demand/BUILD |
Remove the large test size. |
test/extensions/filters/http/mcp_router/mcp_router_integration_test.cc |
Close and drain backend connections before releasing them. |
test/extensions/filters/http/lua/lua_integration_test.cc |
Shorten the drain-test timeout. |
test/extensions/filters/http/lua/BUILD |
Add four shards and remove oversized resource settings. |
test/extensions/filters/http/ext_proc/ext_proc_observability_integration_test.cc |
Preserve an explicit timeout for observability-mode checks. |
test/extensions/filters/http/ext_proc/ext_proc_integration_test.cc |
Set an explicit timeout for delayed-header coverage. |
test/extensions/filters/http/ext_proc/ext_proc_integration_common.cc |
Increase the fixture’s default message timeout. |
test/extensions/filters/http/common/fuzz/uber_filter.cc |
Clear the destroy callback between fuzz inputs. |
test/extensions/filters/http/common/fuzz/filter_corpus/filter_chain_empty_config |
Add an empty filter-chain regression input. |
test/extensions/dynamic_modules/test_data/rust/cluster_integration_test.rs |
Join completion threads before module teardown. |
test/extensions/dynamic_modules/dynamic_modules_test.cc |
Unload modules before deleting their files. |
test/extensions/dynamic_modules/BUILD |
Shard ABI tests eight ways. |
test/common/tls/integration/ssl_integration_test.cc |
Control certificate-validation timing per instance. |
test/common/tls/cert_validator/timed_cert_validator.h |
Add validation-state, callback, and timer controls. |
test/common/tls/cert_validator/timed_cert_validator.cc |
Notify tests when validation starts. |
test/common/listener_manager/filter_chain_benchmark_test.cc |
Remove fixture-owned logging contexts with unsafe exit ordering. |
test/common/listener_manager/BUILD |
Increase listener-manager test sharding. |
contrib/config/test/kv_store_xds_delegate_integration_test.cc |
Delegate synchronized shutdown to the test-server destructor. |
.bazelrc |
Increase per-size MemorySanitizer test timeouts. |
Review effort: Balanced
…oxy#48790) Commit Message: http2: deflake WindowUpdateAfterLargeResponseRealisticClient The test opens the client's window once `upstream_rq_completed` reaches 1, on the assumption that the whole 1 MiB body is buffered in the downstream codec by then. The router charges that counter on the upstream response headers, not at the end of the body, so the window could open while the body was still streaming in. Envoy then sends whatever is pending as one frame and each later upstream chunk as its own, and CI saw 42, 50 or 64 DATA frames where the oghttp2 branch expects 1. This waits for `http2.pending_send_bytes` to reach the body size instead. envoyproxy#48514's 16 KiB cap made the count come out at 64 either way, which hid the race on the default path, but the branch with `http2_oghttp2_cap_data_frame_payload` disabled still asserts a single frame. Additional Description: It failed on 10 changes between 10-11 and 10-23, on msan and tsan, always at the `data_frames` check. It hasn't failed since envoyproxy#48514 landed, because no CI job runs with the cap disabled, so this fixes the wait rather than a flake CI can still hit. To reproduce, I had the autonomous upstream send the 1 MiB body 500ms after the headers, from another thread, with the cap disabled. With the old wait, `pending_send_bytes` was 0 when the wait returned and oghttp2 sent 64 frames, failing every run. With the new wait the test waits out the delay, gets 1 frame, and passes 12/12. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - delayed-body repro above, cap disabled: fails on both oghttp2 params before, 12/12 pass after - `bazel test //test/integration:http2_flood_integration_test --runs_per_test=5`: pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
Commit Message: http2: deflake RstStreamOverflowOnPendingFlushTimeout The test set `stream_idle_timeout` to 400ms only to get a 400ms pending flush timer, since `stream_flush_timeout` defaults to it. The idle timer also covers the pre-fill stream, so that stream's upstream response had to start within 400ms of the request. On a slow runner the idle timeout fired first and left its local reply's two frames queued. The test then timed out waiting for 998 queued frames with "current value 2". This sets `stream_flush_timeout` to 400ms instead and leaves the idle timeout at its default. The flush timeout, RST_STREAM and overflow path the test is about doesn't change. Additional Description: It failed on 9 changes between 10-05 and 10-22 under tsan, always on oghttp2 with "current value 2". envoyproxy#45189 reported the same symptom back in May. Delaying the autonomous upstream's response by 500ms reproduces it on both codecs, so the oghttp2 skew in CI is just that codec being slower. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - 500ms delayed-response repro: 12/12 runs failed with the CI message before, 12/12 pass after (all four codec/IP params) - `bazel test //test/integration:http2_flood_integration_test --runs_per_test=5`: pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A --------- Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
Test was flaky: [example failure](https://github.com/envoyproxy/envoy/actions/runs/39863346500/job/120119395813#step:20:751). ``` [ RUN ] IpVersionsAndMatcher/LdsInplaceUpdateHttpIntegrationTest.ReloadConfigUpdatingDefaultFilterChain/1 test/integration/http_integration.cc:323: Failure Value of: codec->connected() Actual: false Expected: true ``` The race: receiving the complete response doesn’t guarantee the old connection’s close event has arrived. Its later RemoteClose callback exits the shared dispatcher while the new client is waiting for TLS, returning with connected() == false. Performing that disconnect first removes the ordering hazard and also protects the filter-chain deletion test. Assisted with Codex Sol, I understand what it's doing. Risk Level: Test-only Testing: yes Docs Changes: n/a Release Notes: n/a Platform Specific Features: n/a Fixes: envoyproxy#31803 --------- Signed-off-by: Raven Black <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
…envoyproxy#48970) The mcp_router fixture keeps its fake backend connections in its own members rather than fake_upstream_connection_, so cleanupUpstreamAndDownstream() never closes them and they are destroyed with the fixture while the fake upstream thread may still be draining the response write. That frees the HTTP/1 server codec under the write, and the codec's flood-tracking sentinel fragment calls back into it when the write buffer drains: codec_impl.cc:1067: runtime error: member call on address ... which does not point to an object of type 'ServerConnectionImpl' (asan, HeaderForwardingDisallowedWinsOverForwardAll/1, main runs 41674010049 and 41675082565). Close both backend connections and wait for the disconnect in TearDown before the standard cleanup, as cleanupUpstreamAndDownstream() does for fake_upstream_connection_. --------- Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#48964) The fixture never set message_timeout, so every test ran at the filter default of 200ms. Under tsan a round trip through the fake ext_proc server can exceed that: the filter times out and answers 504, so ResponseFromExtProcServerTooLarge saw 504 where it expected the 500 from the oversized response, and later tests timed out waiting for an upstream connection the request never made (run 41653256385, shard 7). Default to 5s where a test has not set one. The timeout tests already set 200ms explicitly; the two that relied on the implicit 200ms to check that no timer is armed (observability mode, FULL_DUPLEX_STREAMED mode override) now set it too. Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#48962) …-headers cases ManyLargeResponseHeadersAccepted with an HTTP/3 upstream aborted on its 30s waitForEndStream in two msan shards (run 41550197758). Per EngFlow test results, the HTTP/3 variants of the two 70 x 100kB header tests take 11-21s under msan (2.4s unsanitized; 3.5s for the HTTP/1 and HTTP/2 variants under msan), with the request-side twin taking 25-34s in the aborted shards. The tests check that many headers totalling far above the 60kB default and close to the configured limit are accepted; the maximum size and count are covered by the VeryLarge* and ManyRequestHeaders* tests. Send 70 x 20kB against a 1600kB limit, the same ratio to the limit at a fifth of the bytes. The target was also `size = "enormous"`. Per-shard test time with 16 shards is 80-95s unsanitized and under asan, 220-250s under tsan and 360-480s (~515s wall) under msan: it needs more shards and an msan timeout scale, which tsan and coverage already have, not an hour. Drop the size, use 24 shards, and scale msan test timeouts as tsan does. Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#48967) ClientInterruptedHandshake asserted cert_active == 1 straight after waitCertsRequested(1). The secret manager increments cert_requested and then cert_active on the main thread, so the test thread can see the counter at 1, close the client and read the gauge before the second increment lands. It did under tsan (run 41663745469): nothing decrements the gauge in that test, so the 0 it read was the increment not having happened yet. Wait for the gauge to reach 1 before closing the client, so the check after the close is checking what it means to: that interrupting the handshake does not drop the outstanding SDS subscription. Signed-off-by: Ryan Northey <[email protected]>
…oyproxy#49036) The test expects the per-worker watchdog counters to exist, but they are created in a post callback on the worker that runs after the listener-ready notification and after the started callback that unblocks the main thread. The admin request added in envoyproxy#32280 is served on the main thread's connection handler and so does not synchronize with the worker at all. Use a worker barrier instead. Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#49077) …ze and pool `lua_integration_test` runs 36 tests over a 20-way protocol/filter position matrix (720 cases); every case boots an Envoy, ~0.1s in opt and ~1.6s under tsan, i.e. ~900s per tsan run hidden behind `size = "large"`. - `DrainConnectionUponCompletion`: the HTTP/2 variants wait for the connection to close after the GOAWAY, which happens from the HCM drain timer (5s by default): 10 cases x 5s per run for a grace period the test is not about. Set it to 100ms. - Shard the target four ways instead of sizing it. - Drop the large RBE pool: measured in CI the test never uses more than one core (0.2 in opt, 1.0 under tsan) and peaks at 1.5GB RSS under asan, against the pool's 8 cores and 12GiB limit; the default pool's 3GiB covers it twice over. Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#49075) …the size Of the 1613 cases this target runs in an opt CI job, 48 take 5s and the other 1565 average 0.14s: - `Retry`, `ReqRespSizeStats` and `UpstreamRequestsPerConnectionMetric` wait for histogram samples, which only reach the parent store on the stats flush (5s by default). Flush every 100ms in those tests. - The HTTP/2 cases of `MaxRequestsPerConnectionReached` and `TestDownstreamResetIdleTimeout` wait for the connection to close after a GOAWAY, which happens from the HCM drain timer (5s by default). Set it to 100ms in those tests. The target was marked "enormous" (a one hour timeout) on 16 shards; its shards run 25-40s in opt and under 200s under tsan, which has a 600s "medium" timeout. Drop the size. Signed-off-by: Ryan Northey <[email protected]>
A drain-close keeps the connection open for the HCM's drain_timeout (5s by default) after the response that announced it, for HTTP/1 as well as HTTP/2: `startDrainSequence()` only moves to Closing from `onDrainTimeout()`. Every drain-closing case in this test waits for that close, so 35 of its 45 cases took 5s each (~180s per run) for a grace period none of them is testing. Set it to 100ms in the fixture and drop the test size. Signed-off-by: Ryan Northey <[email protected]>
…y#49024) GrpcStreamFailure, ConnectionStatusCloseHandling and ConnectionStatusRSTHandling asserted that a write fails immediately after waiting for a stats counter. The counter is incremented on the worker thread before the connection is closed, and the test thread only does a single non-blocking dispatcher run on an empty write, so it can observe the write succeeding before the FIN arrives. Wait for the disconnect first; the write then fails deterministically. Signed-off-by: Ryan Northey <[email protected]>
…y#49080) `shutdownAndRestartTestServer()` posted `server.shutdown()` itself, waited only for that call to return, and then reset the test server. Once `shutdown()` returns, `Server::InstanceImpl::run()` returns on the server thread and the server, a stack object in `createAndRunEnvoyServer()`, is destroyed; `~IntegrationTestServerImpl` meanwhile posts to `server_->dispatcher()` through its still-set raw pointer. When the server thread wins, that is a use-after-free: Caught Segmentation fault, suspect faulting address 0x48 #1: Envoy::IntegrationTestServerImpl::~IntegrationTestServerImpl() #2: KeyValueStoreXdsDelegateIntegrationTest_BasicSuccess_Test::TestBody() The destructor already does the shutdown and waits for the server thread to finish, so just reset the test server. Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
…y#49099) `BasicFailWithoutDefault` and `ConfigUpdateDoesNotApplyToExistingConnection` connect as soon as the ECDS `config_fail`/`config_reload` counter moves. Neither counter means the listener is accepting connections: `config_fail` is incremented before the init target is marked ready, and the listener only calls `listen()` once warming has completed and the workers are being started, so the connection can be refused. The client then sees a disconnect without the connection ever reaching the filter chain, and `BasicFailWithoutDefault` times out waiting for `network_extension_config_missing`. Wait for the listeners to be ready and the workers to be started before connecting, as the HTTP ECDS tests and the other tests in this file already do. --------- Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49172) `cleanup()` closed the fake ratelimit connection with `FlushWrite` and returned without waiting for the disconnect. The fixture then destroyed the `FakeHttpConnection` codec on the main thread while the fake upstream thread could still be draining the write buffer, whose drain trackers call into the codec's `ProtocolConstraints`. ASAN caught this as a heap-use-after-free in `ProtocolConstraints::releaseOutboundFrame()` in `ResponseHeaderHitsAddendOnStreamDone`, which sends the ratelimit response immediately before cleanup (5 failures in 1000 runs). Wait for the disconnect before returning. Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#49070) `OnDemandVhdsWithBodyIntegrationTest::initialize()` waited for the listener before serving the RDS/VHDS streams it warms on, so every case only proceeded once the 15s `initial_fetch_timeout` had given up on the route configuration. The 20 non-skipped cases therefore took ~15s each, putting a 300s test shard on the critical path of any CI job that invalidates `test/integration`. Follow the `VhdsIntegrationTest` sequence instead: defer listener finalization, answer the initial RDS and VHDS requests, then wait for the listener to warm and the workers to start. Signed-off-by: Ryan Northey <[email protected]>
phlax
force-pushed
the
bp-1.40-test-deflakes
branch
from
November 12, 2026 08:50
742b9be to
eb24103
Compare
…#49202) envoyproxy#49099 added `waitUntilListenersReady()` before two tests connect, but that can return immediately here: the fixture clears the static listeners, and the server's pending listener count is only set once the server is ready, which in these tests is after the listener finishes warming. The client can still connect before the workers have the listener. Also wait for `listener_manager.workers_started`, as the other tests in this file already do after `waitUntilListenersReady()`. Backport note: picked from the pull request ahead of its merge to main. Signed-off-by: Ryan Northey <[email protected]>
jwendell
approved these changes
Nov 12, 2026
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Test deflakes and test optimisations from
main, forrelease/v1.40. Test-only: no product code.Clean cherry-picks, in the order they landed on
main:mainStill to come here, as they do not apply cleanly to this branch and need porting: #48512, #48630, #48681 (and #49076, which depends on it), #48867, #48890, #48911, #48960, #49025, #49179, #49120.