Skip to content

test/network_ecds: Wait for the listener before connecting - #49099

Merged
phlax merged 2 commits into
envoyproxy:mainfrom
phlax:network-ecds-test-listener-ready
Nov 10, 2026
Merged

phlax merged 2 commits into
envoyproxy:mainfrom
phlax:network-ecds-test-listener-ready

Conversation

@phlax

@phlax phlax commented Nov 9, 2026

Copy link
Copy Markdown
Member

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.

`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]>

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 remain for the listener and worker readiness waits added to the two ECDS integration tests.

No open issues 🎉

What changed in this PR

This PR addresses a connection-startup race in two network ECDS integration tests by waiting for listener readiness and worker startup before connecting.

Changes:

  • Adds readiness waits to BasicFailWithoutDefault and ConfigUpdateDoesNotApplyToExistingConnection.
  • Documents why ECDS counter updates alone do not guarantee that the listener is accepting connections.
File Description
test/​integration/​network_extension_discovery_integration_test.cc Adds listener and worker readiness waits before opening TCP connections in two tests.

Review effort: Balanced

Comment on lines +435 to +436
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.

Are both of these waits necessary? Seems like one or the other should be sufficient. (waitUntilListenersReady is the preferred one to keep if they're equivalent.)

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.

Equivalent here: workers_started is set by the completion that runs in the same posted lambda right after the onWorkerListenerAdded hook that releases waitUntilListenersReady() (worker_impl.cc:79), so with one listener and one worker either wait is enough. Kept waitUntilListenersReady() only (39b6adb); I had copied both from the sendDataVerifyResults helper in this file.

(bot assisted)

The workers_started gauge is set by the completion that runs right after the hook that releases
waitUntilListenersReady(), so waiting on both was redundant.

Signed-off-by: Ryan Northey <[email protected]>
@phlax
phlax enabled auto-merge (squash) November 10, 2026 19:27
@phlax
phlax disabled auto-merge November 10, 2026 20:18
@phlax
phlax merged commit 867b47e into envoyproxy:main Nov 10, 2026
25 checks passed
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
…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]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
…#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]>
phlax added a commit that referenced this pull request Nov 12, 2026
#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
jwendell pushed a commit that referenced this pull request Nov 12, 2026
`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]>
jwendell pushed a commit that referenced this pull request Nov 12, 2026
#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]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
Backport note (release/v1.38): with this branch's `waitForGaugeGe()`, as the rest of the
file uses.

(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
Backport note (release/v1.37): with this branch's `waitForGaugeGe()`, as the rest of the
file uses.

(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
Backport note (release/v1.38): with this branch's `waitForGaugeGe()`, as the rest of the
file uses.

(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
`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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
Backport note (release/v1.38): with this branch's `waitForGaugeGe()`, as the rest of the
file uses.

(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
Backport note (release/v1.37): with this branch's `waitForGaugeGe()`, as the rest of the
file uses.

(cherry picked from commit 8def710)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 18, 2026
…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]>
(cherry picked from commit 867b47e)
Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 18, 2026
…#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, and the test then times out waiting for
`network_extension_config_missing`.

Also wait for `listener_manager.workers_started`, as the other tests in
this file already do after `waitUntilListenersReady()`.

Deflake runs of `BasicFailWithoutDefault` and
`ConfigUpdateDoesNotApplyToExistingConnection`, 1000 runs each:

| | default | tsan |
| --- | --- | --- |
| main | 4 failed | 30 failed |
| this change | 0 failed | 0 failed |

All of the failures were `BasicFailWithoutDefault`, timing out on
`listener.listener_stat.network_extension_config_missing`.

Signed-off-by: Ryan Northey <[email protected]>
Backport note (release/v1.37): with this branch's `waitForGaugeGe()`, as the rest of the
file uses.

(cherry picked from commit 8def710)
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