Skip to content

test/listener_ecds: Wait for the workers before connecting - #49219

Merged
phlax merged 2 commits into
envoyproxy:mainfrom
phlax:test-listener-ecds-wait-workers
Nov 13, 2026
Merged

phlax merged 2 commits into
envoyproxy:mainfrom
phlax:test-listener-ecds-wait-workers

Conversation

@phlax

@phlax phlax commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

BasicFailWithoutDefault connects as soon as the config failure has completed warming, but the listener only starts listening once the workers have added it. The client can connect before that, and the test then times out waiting for extension_config_missing.

Wait for the listeners and for listener_manager.workers_started, as the other tests in this file do in sendDataVerifyResults(), and as #49202 did for the same test of network ECDS.

Seen in postsubmit CI on main (tsan, BasicFailWithoutDefault/2: timed out waiting for listener.listener_stat.extension_config_missing).

Testing: *ListenerExtensionDiscoveryIntegrationTest.BasicFailWithoutDefault* with --config=tsan on RBE, 1000 runs each:

failed
main (1ad62cc) 34
this change 0

All of the failures on main were the timeout on listener.listener_stat.extension_config_missing.

Risk Level: low (test only)

Fixes #26939

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#49202 did for the same test of network ECDS.
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #49219 was opened by phlax.

see: more, trace.

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 this test-only change to synchronize connections with listener readiness.

No open issues 🎉

What changed in this PR

This test-only change prevents BasicFailWithoutDefault from connecting before listener workers are ready, addressing intermittent timeouts while waiting for extension_config_missing.

Changes:

  • Waits for listener readiness and listener_manager.workers_started before connecting.
  • Aligns startup synchronization with other listener ECDS tests and the network ECDS fix in #49202.
File Description
test/​integration/​listener_extension_discovery_integration_test.cc Adds readiness waits and an explanatory comment before the test client connects.

Review effort: Balanced

@phlax
phlax marked this pull request as ready for review November 13, 2026 00:33
@phlax phlax changed the title [WIP] test/listener_ecds: Wait for the workers before connecting test/listener_ecds: Wait for the workers before connecting Nov 13, 2026
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
@phlax phlax added the backport/review Request to backport to stable releases label Nov 13, 2026
Comment on lines +456 to +457
test_server_->waitUntilListenersReady();
test_server_->waitForGauge("listener_manager.workers_started", Ge(1));

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.

I think this is the same thing I've commented before, and you concluded that this does work the same without the metric check; it's better without the metric check, since the test isn't about validating that metric and the other wait is more readable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks - will try to rem

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed: waitUntilListenersReady() only returns once the workers have added the listener, so the gauge wait adds nothing. Dropped in 6f7c7ab.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i agree 100% with myself

@ravenblackx ravenblackx self-assigned this Nov 13, 2026
`waitUntilListenersReady()` already waits for the workers to add the
listener, and the test is not about that metric.

Signed-off-by: Ryan Northey <[email protected]>
@phlax
phlax enabled auto-merge (squash) November 13, 2026 20:27
@phlax
phlax merged commit 998221c into envoyproxy:main Nov 13, 2026
25 checks passed
phlax added a commit to phlax/envoy that referenced this pull request Nov 13, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners, which only completes once the workers have added
them, as envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners, which only completes once the workers have added
them, as envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…y#49219)

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners, which only completes once the workers have added
them, as #49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

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

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.

(cherry picked from commit 998221c)

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

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

(cherry picked from commit 998221c)

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

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

(cherry picked from commit 998221c)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

(cherry picked from commit 998221c)

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

`BasicFailWithoutDefault` connects as soon as the config failure has
completed warming, but the listener only starts listening once the
workers have added it. The client can connect before that, and the test
then times out waiting for `extension_config_missing`.

Wait for the listeners and for `listener_manager.workers_started`, as
the other tests in this file do in `sendDataVerifyResults()`, and as

envoyproxy#49202 did for the same test of network ECDS.

Backport note: picked from the pull request ahead of its merge to main.
This branch waits with `waitForCounterGe()` and `waitForGaugeGe()`.

(cherry picked from commit 998221c)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Dec 1, 2026
`BasicFailWithoutDefault` still fails in CI after envoyproxy#49219 (asan, timed out
waiting for `listener.listener_stat.extension_config_missing`).

envoyproxy#49219 added `waitUntilListenersReady()`, which waits for the workers to add
the listeners the server had when it was created. The listener here comes
from LDS, and when LDS has not delivered it by then there is nothing to wait
for, so the call returns at once. The client then connects before
`listen()`, is refused, and the counter never moves.

Also wait for `listener_manager.workers_started`, as every other test in
this file does in `sendDataVerifyResults()`.
Testing: the whole target with `--config=asan` on RBE, 200 runs each (the
isolated test did not fail in 1000 runs):

| | failed |
| --- | --- |
| main (a7bbc3e) | 3 |
| main with stat dumps added | 1 |
| this change | 0 |

In the failing run with stat dumps, `listener_manager.workers_started` and
`listener_create_success` were still 0 after `waitUntilListenersReady()`
returned, and the write failed with an unexpected disconnect.

Risk Level: low (test only)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Dec 1, 2026
`BasicFailWithoutDefault` still fails in CI after envoyproxy#49219 (asan, timed out
waiting for `listener.listener_stat.extension_config_missing`).

envoyproxy#49219 added `waitUntilListenersReady()`, which waits for the workers to add
the listeners the server had when it was created. The listener here comes
from LDS, and when LDS has not delivered it by then there is nothing to wait
for, so the call returns at once. The client then connects before
`listen()`, is refused, and the counter never moves.

Also wait for `listener_manager.workers_started`, as every other test in
this file does in `sendDataVerifyResults()`.

Testing: the whole target with `--config=asan` on RBE, 200 runs each (the
isolated test did not fail in 1000 runs):

| | failed |
| --- | --- |
| main (a7bbc3e) | 3 |
| main with stat dumps added | 1 |
| this change | 0 |

In the failing run with stat dumps, `listener_manager.workers_started` and
`listener_create_success` were still 0 after `waitUntilListenersReady()`
returned, and the write failed with an unexpected disconnect.

Risk Level: low (test only)

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

backport/review Request to backport to stable releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test IpVersionsClientType/ListenerExtensionDiscoveryIntegrationTest.BasicFailWithoutDefault

3 participants