[core] Add shared ClockInterface and fake clock for testing#62476
Merged
Conversation
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
…es/unavailable-backoff
…es/gcs-hc-all-threads
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
…es/io-context-monitor
…es/io-context-monitor
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new ClockInterface and its implementations (Clock and FakeClock) to standardize time retrieval across the codebase, replacing direct absl::Now() calls and manual time-tracking logic in tests. The changes include updating various scheduling components and tests to inject the clock interface. The review feedback suggests marking the Now() methods as const and declaring the Clock and FakeClock classes as final to improve API design and enable potential compiler optimizations.
sampan-s-nayak
approved these changes
Apr 10, 2026
This was referenced Apr 10, 2026
HLDKNotFound
pushed a commit
to chichic21039/ray
that referenced
this pull request
Apr 22, 2026
…oject#62476) Wanted this for an upcoming PR for deterministic unit testing, so adding it here and replacing some existing tests that had their own version. Was also able to make the timestamp checks in `local_resource_manager_test.cc` deterministic. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
edoakes
added a commit
that referenced
this pull request
May 13, 2026
- Update gcs components to use the interface introduced in: #62476 - Updated tests to use `FakeClock` - Added additional convenience methods to `ClockInterface` --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Lucas61000
pushed a commit
to Lucas61000/ray
that referenced
this pull request
May 15, 2026
…oject#62476) Wanted this for an upcoming PR for deterministic unit testing, so adding it here and replacing some existing tests that had their own version. Was also able to make the timestamp checks in `local_resource_manager_test.cc` deterministic. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
rueian
pushed a commit
to rueian/ray
that referenced
this pull request
Jun 4, 2026
…y-project#62562) - Update Raylet subcomponents to use the interface introduced in: ray-project#62476 - Updated tests to use FakeClock --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
limarkdcunha
pushed a commit
to limarkdcunha/ray
that referenced
this pull request
Jun 30, 2026
…y-project#62562) - Update Raylet subcomponents to use the interface introduced in: ray-project#62476 - Updated tests to use FakeClock --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
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.
Wanted this for an upcoming PR for deterministic unit testing, so adding it here and replacing some existing tests that had their own version.
Was also able to make the timestamp checks in
local_resource_manager_test.ccdeterministic.