Repository navigation
test: use DefaultTimeout for waitForCounter in shadow policy tests - #48352
Merged
Merged
Conversation
Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In BackedUpConnectionBeforeShadowBegins, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in RequestMirrorPolicyWithShadowUpstreamReset has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in BackedUpConnectionBeforeShadowBegins is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Signed-off-by: Alejandro R. Sedeño <[email protected]>
RyanTheOptimist
approved these changes
Oct 15, 2026
jwendell
pushed a commit
that referenced
this pull request
Nov 12, 2026
…48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
that referenced
this pull request
Nov 17, 2026
…48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 18, 2026
…nvoyproxy#48352) Two positive `waitForCounter()` assertions in shadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode `TestUtility::DefaultTimeout`, which is scaled by `TIMEOUT_FACTOR` under sanitizers. In `BackedUpConnectionBeforeShadowBegins`, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails with `downstream_flow_control_paused_reading_total` still at 0, even though it reaches 1 later in the same run (the final `EXPECT_EQ` on that counter still passes). The 1000ms wait on `cluster.cluster_1.upstream_rq_rx_reset` in `RequestMirrorPolicyWithShadowUpstreamReset` has the same weakness. Drop the explicit timeouts so both waits use `DefaultTimeout`. This costs nothing on passing runs because `waitForCounter()` returns as soon as the counter matches. The 500ms negative wait on `waitForEndStream()` in `BackedUpConnectionBeforeShadowBegins` is intentional and left unchanged. Lowering the 500ms timeout to 50ms reproduces the failure reliably under `--config=tsan`. With this change, 200 runs under TSAN passed with no flakes. AI was used in debugging and authoring this PR. Risk Level: Low Testing: CI, local testing Signed-off-by: Alejandro R. Sedeño <[email protected]> (cherry picked from commit eeaf23f) Signed-off-by: Ryan Northey <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two positive
waitForCounter()assertions inshadow_policy_integration_test.cc used hardcoded timeouts (500ms and 1000ms). These overrode
TestUtility::DefaultTimeout, which is scaled byTIMEOUT_FACTORunder sanitizers.In
BackedUpConnectionBeforeShadowBegins, it can take longer than 500ms under TSAN on a loaded machine to set up the upstream shadow connection and fill its write buffer past the high watermark. The test then fails withdownstream_flow_control_paused_reading_totalstill at 0, even though it reaches 1 later in the same run (the finalEXPECT_EQon that counter still passes). The 1000ms wait oncluster.cluster_1.upstream_rq_rx_resetinRequestMirrorPolicyWithShadowUpstreamResethas the same weakness. Drop the explicit timeouts so both waits useDefaultTimeout. This costs nothing on passing runs becausewaitForCounter()returns as soon as the counter matches. The 500ms negative wait onwaitForEndStream()inBackedUpConnectionBeforeShadowBeginsis intentional and left unchanged.Lowering the 500ms timeout to 50ms reproduces the failure reliably under
--config=tsan. With this change, 200 runs under TSAN passed with no flakes.AI was used in debugging and authoring this PR.
Risk Level: Low
Testing: CI, local testing