Repository navigation
test: deflake GrpcJsonTranscoderIntegrationTest multi-request cases - #49303
Conversation
testTranscoding closes the fake upstream connection at the end of each call, but waitForDisconnect only sees the fake side's local close. Envoy's worker can still pick up the next request in the same test before it processes the remote close, assign it to the dead HTTP/2 connection, and the fake upstream never sees a new connection. Wait for cluster_0's upstream_cx_active gauge to reach zero after the close so every follow-up request gets a fresh upstream connection. Signed-off-by: Derek Argueta <[email protected]>
|
Deflake numbers (envoy-ci-staging, whole binary, so test ordering is as in CI):
So no repro in isolation, although this fails frequently in CI and has had several fix attempts that were never reproduced (see #44427/#44510). I'm also not convinced by the mechanism. Each Could you link the CI run where (bot assisted) fwiw ive tried several times to fix this - but never been able to repro so never landed anything |
|
Here's the run: https://github.com/envoyproxy/envoy/actions/runs/43680824372/job/132710880787. It's a release build so there's no trace, just the timeout at :78. I can't reproduce it and your ordering argument holds, so I'll close this. |
|
Reopening: the diagnostics in #49317 caught the failure in CI (https://github.com/envoyproxy/envoy/actions/runs/43914182683/job/133463916675, The third request went out on the pooled connection the test had just closed, before Envoy had processed the close. No new connection was opened. That is what the (bot assisted) |
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as #44427 on `DisableRequestValidation`, which #44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
nice sleuthing, thanks @phlax ! |
…nvoyproxy#49303) `testTranscoding()` closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection and `waitForHttpConnection()` times out. The helper now waits for `cluster.cluster_0.upstream_cx_active` to drop to 0 after the close. Additional Description: This hit `ServerStreamingGet/IPv4`, which sends three requests. It's the same failure as envoyproxy#44427 on `DisableRequestValidation`, which envoyproxy#44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that pass `expect_connection_to_upstream=false` are local replies, so the wait returns immediately for them. AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - `bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_test` passes - same target with `--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50`: 400/400 pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Backport note (release/v1.38): with this branch's `waitForGaugeEq()`, as it has no `waitForGauge()` matcher overload (envoyproxy#44864). (cherry picked from commit b794d7a) Signed-off-by: Ryan Northey <[email protected]>
Commit Message: test: deflake GrpcJsonTranscoderIntegrationTest multi-request cases
testTranscoding()closes the fake upstream connection after each request and waits for the fake side to disconnect, but nothing waits for Envoy to process that close. Tests that call it more than once can have the next request handed to the dead pooled HTTP/2 connection, so the fake upstream never sees a new connection andwaitForHttpConnection()times out. The helper now waits forcluster.cluster_0.upstream_cx_activeto drop to 0 after the close.Additional Description:
This hit
ServerStreamingGet/IPv4, which sends three requests. It's the same failure as #44427 onDisableRequestValidation, which #44510 worked around by splitting that test into single-request tests. About 25 other tests in the file make several calls and pick this up too. The calls that passexpect_connection_to_upstream=falseare local replies, so the wait returns immediately for them.AI Disclosure: code change created with AI assistance, fully reviewed by me prior to opening.
Risk Level: Low (test only)
Testing:
bazel test //test/extensions/filters/http/grpc_json_transcoder:grpc_json_transcoder_integration_testpasses--test_filter='IpVersions/GrpcJsonTranscoderIntegrationTest.ServerStreaming*' --runs_per_test=50: 400/400 pass (macOS arm64, fastbuild)Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A