Repository navigation
test/network_ecds: Wait for the listener before connecting - #49099
Conversation
`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]>
There was a problem hiding this comment.
🟢 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
BasicFailWithoutDefaultandConfigUpdateDoesNotApplyToExistingConnection. - 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
| test_server_->waitUntilListenersReady(); | ||
| test_server_->waitForGauge("listener_manager.workers_started", Ge(1)); |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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]>
…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]>
…#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]>
#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]>
`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]>
#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]>
…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]>
…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]>
…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]>
…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]>
…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]>
…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]>
…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]>
…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]>
…#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]>
…#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]>
…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]>
…#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]>
…#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]>
…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]>
…#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]>
…#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]>
`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]>
…#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]>
…#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]>
…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]>
…#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]>
BasicFailWithoutDefaultandConfigUpdateDoesNotApplyToExistingConnectionconnect as soon as the ECDSconfig_fail/config_reloadcounter moves. Neither counter means the listener is accepting connections:config_failis incremented before the init target is marked ready, and the listener only callslisten()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, andBasicFailWithoutDefaulttimes out waiting fornetwork_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.