Repository navigation
Use simulated time with http3, in OverloadIntegrationTest - #49120
Merged
Merged
Conversation
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
ravenblackx
marked this pull request as ready for review
November 10, 2026 22:25
ravenblackx
requested review from
RyanTheOptimist,
abeyad,
botengyao,
kyessenov,
mattklein123,
nezdolik,
tonya11en,
wbpcode and
yanavlasov
as code owners
November 10, 2026 22:25
phlax
reviewed
Nov 10, 2026
phlax
left a comment
Member
There was a problem hiding this comment.
Mostly looks right, a few specific things below. The main one is the per-spin time advance; the rest are smaller.
If useful, we can run a tsan/asan deflake of the touched suites (overload, multiplexed simtime, fcds) on envoy-ci-staging against this branch before it merges, rather than finding out on main.
(bot assisted)
Signed-off-by: Raven Black <[email protected]>
ravenblackx
added a commit
that referenced
this pull request
Nov 11, 2026
Commit Message: [tests] Don't rely on fake monotonic time starting at epoch 0 Additional Description: Currently many tests rely on the fake monotonic time running from zero. This is misleading and can lead to fragile tests; time should be relative. It's also incompatible with using fake monotonic time in http3 contexts because some http3 code uses zero-time to mean the timer is uninitialized. This changes the default to starting at 1 second, so we can't incorrectly rely on zero-epoch and so it can be used with http3, and updates all the tests that relied on it starting at 0 to use relative time, including the fragile test of token buckets, in which the behavior of floating point rounding changes when the start time changes. This is a split from PR #49120. Risk Level: test-only Testing: yes Docs Changes: n/a Release Notes: n/a Platform Specific Features: n/a Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
This was referenced Nov 12, 2026
phlax
added a commit
that referenced
this pull request
Nov 16, 2026
`Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
that referenced
this pull request
Nov 17, 2026
`Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 18, 2026
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) 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.
Commit Message: Use simulated time with http3, in OverloadIntegrationTest
Additional Description:
This makes OverloadIntegrationTest take less than half as long.
This has gone a bit beyond the original scope; in order to support simulated time in http3 we needed the TimeSource to be initialized to nonzero, because some http3 code treats zero time as not yet initialized (or we needed to give it special treatment in http3 test context, which would have just been confusing in the long run, or it needed that production code touched, and I really wanted to keep this test-only). So that change required updating a whole mess of tests because they relied on time being initialized as zero rather than operating on deltas (which they should have always been).
Then I also rolled in a 5 second default timeout for waits on I/O so test failures are prompt and useful rather than "test timed out" hard to debug, but that timeout required even more tests to be updated because some of them relied on taking five seconds to resolve. As a result this change will also make several other integration tests complete more quickly.
And a comedy one, token buckets with time initialized to 1 second happened to round down their floating point numbers, where when they initialized to 0 seconds the floating point numbers rounded up. The tests shouldn't have been relying on floating point precision to that extent, so now they add an extra microsecond to ensure floating point imprecision doesn't prevent receiving a whole token when it's expected.
Risk Level: test-only
Testing: yes it is
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a