Skip to content

[tests] Don't rely on fake monotonic time starting at epoch 0 - #49179

Merged
ravenblackx merged 1 commit into
envoyproxy:mainfrom
ravenblackx:simtime_relative
Nov 11, 2026
Merged

ravenblackx merged 1 commit into
envoyproxy:mainfrom
ravenblackx:simtime_relative

Conversation

@ravenblackx

Copy link
Copy Markdown
Contributor

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

@phlax phlax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @ravenblackx

@ravenblackx
ravenblackx enabled auto-merge (squash) November 11, 2026 17:33
@phlax

phlax commented Nov 11, 2026

Copy link
Copy Markdown
Member

/retest flakey infra

@ravenblackx
ravenblackx merged commit 47fbc75 into envoyproxy:main Nov 11, 2026
25 checks passed
@ravenblackx
ravenblackx deleted the simtime_relative branch November 11, 2026 19:04
oschaaf added a commit to We-Amp/envoy that referenced this pull request Nov 27, 2026
main's simulated time no longer starts at epoch 0 (envoyproxy#49179), and
setMonotonicTime() ignores a move backwards. The two cases that wait
for the delayed close timer set the clock to 0 ms and then 100 ms, so
on main the timer never fired and they hung. They now advance the
clock by 100 ms from its current value, as the other delayed close
tests in this file do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants