Skip to content

test: deflake LdsInplaceUpdateHttpIntegrationTest.ReloadConfigUpdatingDefaultFilterChain - #49318

Merged
phlax merged 1 commit into
envoyproxy:mainfrom
phlax:fix-lds-default-chain-flake
Nov 16, 2026
Merged

phlax merged 1 commit into
envoyproxy:mainfrom
phlax:fix-lds-default-chain-flake

Conversation

@phlax

@phlax phlax commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Commit Message: test: deflake LdsInplaceUpdateHttpIntegrationTest.ReloadConfigUpdatingDefaultFilterChain
Additional Description:
The test runs in this order:

  1. It opens a client on the default filter chain.
  2. It replaces that filter chain via LDS.
  3. It connects a second client.
  4. Only then does it send a request on the first client.

The replaced chain is hard-closed drainTime() (1s in integration tests) after the update. Under tsan, the second client's TLS handshake can run past that deadline. When it does:

  • The first client's RemoteClose lands on the shared dispatcher, and IntegrationCodecClient exits the dispatcher on it.
  • makeHttpConnection() therefore returns before the second client has connected, so connected() is false.
  • The next request on the closed first client then asserts on state() == Open.

Example: https://github.com/envoyproxy/envoy/actions/runs/43830092397/job/133173181415

The fix gives this test a drain time it cannot outrun. It never waits for the drained chain to be removed. #48634 fixed the same hazard in expectResponseHeaderConnectionClose.

Risk Level: Low (test only)
Testing: tsan deflake on envoy-ci-staging, filtered to this test.

main this PR
forced (1.5s sleep before the second connect) 20/20 fail (run) 20/20 pass (run)
natural 2/500 fail (run) 500/500 pass (run)

Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Previously reported (closed): #29842, #31803, #33250, #38264, #44744

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the test-only drain-timeout adjustment.

No open issues 🎉

What changed in this PR

This test-only change addresses a recurring default-filter-chain update flake by preventing the old connection’s drain deadline from interrupting a second client’s TLS handshake.

Changes:

  • Sets this test’s drain timeout to 600 seconds before initialization.
  • Adds a comment explaining how an early connection close can interrupt the shared dispatcher’s connect wait.
File Description
test/​integration/​xds_integration_test.cc Extends the drain timeout for ReloadConfigUpdatingDefaultFilterChain and documents the timing hazard.

Review effort: Balanced

…gDefaultFilterChain

The test opens a client on the default filter chain, updates the default
filter chain via LDS, connects a second client and only then sends a
request on the first. The replaced filter chain is hard-closed after
drainTime() (1s in integration tests). When the second client's TLS
handshake runs past that, the first client's RemoteClose exits the shared
dispatcher while makeHttpConnection() waits, so the new client reports
connected() == false and the following request on the closed client
asserts.

Use a drain time that the test cannot outrun. The test never waits for
the drained filter chain to be removed.

Signed-off-by: Ryan Northey <[email protected]>
@phlax
phlax force-pushed the fix-lds-default-chain-flake branch from 4960e1a to f8f0aeb Compare November 16, 2026 10:34
@phlax
phlax merged commit 9ee2de5 into envoyproxy:main Nov 16, 2026
26 checks passed
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…gDefaultFilterChain (envoyproxy#49318)

Commit Message: test: deflake
LdsInplaceUpdateHttpIntegrationTest.ReloadConfigUpdatingDefaultFilterChain
Additional Description:
The test runs in this order:
1. It opens a client on the default filter chain.
2. It replaces that filter chain via LDS.
3. It connects a second client.
4. Only then does it send a request on the first client.

The replaced chain is hard-closed `drainTime()` (1s in integration
tests) after the update. Under tsan, the second client's TLS handshake
can run past that deadline. When it does:
- The first client's `RemoteClose` lands on the shared dispatcher, and
`IntegrationCodecClient` exits the dispatcher on it.
- `makeHttpConnection()` therefore returns before the second client has
connected, so `connected()` is false.
- The next request on the closed first client then asserts on `state()
== Open`.

Example:
https://github.com/envoyproxy/envoy/actions/runs/43830092397/job/133173181415

The fix gives this test a drain time it cannot outrun. It never waits
for the drained chain to be removed. envoyproxy#48634 fixed the same hazard in
`expectResponseHeaderConnectionClose`.

Risk Level: Low (test only)
Testing: tsan deflake on envoy-ci-staging, filtered to this test.

| | main | this PR |
|---|---|---|
| forced (1.5s sleep before the second connect) | 20/20 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846075670))
| 20/20 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846095251))
|
| natural | 2/500 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846114293))
| 500/500 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846133288))
|

Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Previously reported (closed): envoyproxy#29842, envoyproxy#31803, envoyproxy#33250, envoyproxy#38264, envoyproxy#44744

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 9ee2de5)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…gDefaultFilterChain (envoyproxy#49318)

Commit Message: test: deflake
LdsInplaceUpdateHttpIntegrationTest.ReloadConfigUpdatingDefaultFilterChain
Additional Description:
The test runs in this order:
1. It opens a client on the default filter chain.
2. It replaces that filter chain via LDS.
3. It connects a second client.
4. Only then does it send a request on the first client.

The replaced chain is hard-closed `drainTime()` (1s in integration
tests) after the update. Under tsan, the second client's TLS handshake
can run past that deadline. When it does:
- The first client's `RemoteClose` lands on the shared dispatcher, and
`IntegrationCodecClient` exits the dispatcher on it.
- `makeHttpConnection()` therefore returns before the second client has
connected, so `connected()` is false.
- The next request on the closed first client then asserts on `state()
== Open`.

Example:
https://github.com/envoyproxy/envoy/actions/runs/43830092397/job/133173181415

The fix gives this test a drain time it cannot outrun. It never waits
for the drained chain to be removed. envoyproxy#48634 fixed the same hazard in
`expectResponseHeaderConnectionClose`.

Risk Level: Low (test only)
Testing: tsan deflake on envoy-ci-staging, filtered to this test.

| | main | this PR |
|---|---|---|
| forced (1.5s sleep before the second connect) | 20/20 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846075670))
| 20/20 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846095251))
|
| natural | 2/500 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846114293))
| 500/500 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846133288))
|

Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Previously reported (closed): envoyproxy#29842, envoyproxy#31803, envoyproxy#33250, envoyproxy#38264, envoyproxy#44744

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 9ee2de5)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
…gDefaultFilterChain (#49318)

Commit Message: test: deflake
LdsInplaceUpdateHttpIntegrationTest.ReloadConfigUpdatingDefaultFilterChain
Additional Description:
The test runs in this order:
1. It opens a client on the default filter chain.
2. It replaces that filter chain via LDS.
3. It connects a second client.
4. Only then does it send a request on the first client.

The replaced chain is hard-closed `drainTime()` (1s in integration
tests) after the update. Under tsan, the second client's TLS handshake
can run past that deadline. When it does:
- The first client's `RemoteClose` lands on the shared dispatcher, and
`IntegrationCodecClient` exits the dispatcher on it.
- `makeHttpConnection()` therefore returns before the second client has
connected, so `connected()` is false.
- The next request on the closed first client then asserts on `state()
== Open`.

Example:
https://github.com/envoyproxy/envoy/actions/runs/43830092397/job/133173181415

The fix gives this test a drain time it cannot outrun. It never waits
for the drained chain to be removed. #48634 fixed the same hazard in
`expectResponseHeaderConnectionClose`.

Risk Level: Low (test only)
Testing: tsan deflake on envoy-ci-staging, filtered to this test.

| | main | this PR |
|---|---|---|
| forced (1.5s sleep before the second connect) | 20/20 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846075670))
| 20/20 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846095251))
|
| natural | 2/500 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846114293))
| 500/500 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846133288))
|

Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Previously reported (closed): #29842, #31803, #33250, #38264, #44744

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 9ee2de5)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…gDefaultFilterChain (envoyproxy#49318)

Commit Message: test: deflake
LdsInplaceUpdateHttpIntegrationTest.ReloadConfigUpdatingDefaultFilterChain
Additional Description:
The test runs in this order:
1. It opens a client on the default filter chain.
2. It replaces that filter chain via LDS.
3. It connects a second client.
4. Only then does it send a request on the first client.

The replaced chain is hard-closed `drainTime()` (1s in integration
tests) after the update. Under tsan, the second client's TLS handshake
can run past that deadline. When it does:
- The first client's `RemoteClose` lands on the shared dispatcher, and
`IntegrationCodecClient` exits the dispatcher on it.
- `makeHttpConnection()` therefore returns before the second client has
connected, so `connected()` is false.
- The next request on the closed first client then asserts on `state()
== Open`.

Example:
https://github.com/envoyproxy/envoy/actions/runs/43830092397/job/133173181415

The fix gives this test a drain time it cannot outrun. It never waits
for the drained chain to be removed. envoyproxy#48634 fixed the same hazard in
`expectResponseHeaderConnectionClose`.

Risk Level: Low (test only)
Testing: tsan deflake on envoy-ci-staging, filtered to this test.

| | main | this PR |
|---|---|---|
| forced (1.5s sleep before the second connect) | 20/20 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846075670))
| 20/20 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846095251))
|
| natural | 2/500 fail
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846114293))
| 500/500 pass
([run](https://github.com/envoyproxy/envoy-ci-staging/actions/runs/43846133288))
|

Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Previously reported (closed): envoyproxy#29842, envoyproxy#31803, envoyproxy#33250, envoyproxy#38264, envoyproxy#44744

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 9ee2de5)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…gDefaultFilterChain (envoyproxy#49318)

The test opens a client on the default filter chain, updates the default
filter chain via LDS, connects a second client and only then sends a
request on the first. The replaced filter chain is hard-closed after
drainTime() (1s in integration tests). When the second client's TLS
handshake runs past that, the first client's RemoteClose exits the shared
dispatcher while makeHttpConnection() waits, so the new client reports
connected() == false and the following request on the closed client
asserts.

Use a drain time that the test cannot outrun. The test never waits for
the drained filter chain to be removed.

(cherry picked from commit 9ee2de5)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…gDefaultFilterChain (envoyproxy#49318)

The test opens a client on the default filter chain, updates the default
filter chain via LDS, connects a second client and only then sends a
request on the first. The replaced filter chain is hard-closed after
drainTime() (1s in integration tests). When the second client's TLS
handshake runs past that, the first client's RemoteClose exits the shared
dispatcher while makeHttpConnection() waits, so the new client reports
connected() == false and the following request on the closed client
asserts.

Use a drain time that the test cannot outrun. The test never waits for
the drained filter chain to be removed.

(cherry picked from commit 9ee2de5)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
…gDefaultFilterChain (#49318)

The test opens a client on the default filter chain, updates the default
filter chain via LDS, connects a second client and only then sends a
request on the first. The replaced filter chain is hard-closed after
drainTime() (1s in integration tests). When the second client's TLS
handshake runs past that, the first client's RemoteClose exits the shared
dispatcher while makeHttpConnection() waits, so the new client reports
connected() == false and the following request on the closed client
asserts.

Use a drain time that the test cannot outrun. The test never waits for
the drained filter chain to be removed.

(cherry picked from commit 9ee2de5)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 18, 2026
…gDefaultFilterChain (envoyproxy#49318)

The test opens a client on the default filter chain, updates the default
filter chain via LDS, connects a second client and only then sends a
request on the first. The replaced filter chain is hard-closed after
drainTime() (1s in integration tests). When the second client's TLS
handshake runs past that, the first client's RemoteClose exits the shared
dispatcher while makeHttpConnection() waits, so the new client reports
connected() == false and the following request on the closed client
asserts.

Use a drain time that the test cannot outrun. The test never waits for
the drained filter chain to be removed.

(cherry picked from commit 9ee2de5)

Signed-off-by: Ryan Northey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants