Repository navigation
test(computers): a multi env's computer keeps within 1 s of its gateway's clock through jumps, rates, a kill and a reset (FD-5482) - #684
Open
earakely-scale wants to merge 3 commits into
Conversation
…in 1 s of its gateway's clock through jumps, rates, a kill and a reset (FD-5482) computer_clock_test's one deploy now also takes the gateway's clock a week on and a month back, to a rate of 60, frozen and running again, each checked from inside the computer: the session's time read between two reads of real time, so no driver or exec latency is in it and the bound tightens from 5 s to 1 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rate change reaches the session's clock the follower's reaction late, carried at the old rate until the next jump: about 1 ms on a loaded host, 67 ms at rate 60. At 10 the follower would have to be 100 ms late to reach the 1 s bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… clock's rate, and the skew is checked at rate 10 too A reading is taken again until half its bracket of real time, at the clock's rate, is at most 0.25 universe seconds, the gateway's as the computer's, and fails after five tries; so the rate is known to within a few percent and the skew at rate 10 to within 0.5 s of its truth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What changes
FD-5482 (HB1.11), the CI test of the computer's clock across jumps in a multi env, built as a lean extension of
computer_clock_test, so it adds seconds to CI, not a deploy.That test already deploys a multi env with the
ubuntu-24.04desktop and an MCP server and arms its clock withsync_env_clock. On the same deploy, it now also takes the gateway's clock:advance), and a month back (set_time);set_rate);After each change, once the follower has acknowledged it (each write waits for it with
wait_followers_s, as #672 is deferred), it checks that the session's clock is within 1 s of the gateway's, at the rate of 10 too. At the rate of 10 and frozen, it also checks that the session's clock runs at 10 and stands still. The old check allowed 5 s.How it stays reliable. Each reading is taken inside the computer, in one command: real time, the session's time, then real time again, each a fresh
date, the first and last on real time (AGENTENV_REAL_TIME=1). Driver and exec latency are outside the bracket. The gateway's state is read from the test, bracketed by real time the same way, and carried at its rate to the computer's real time. Either reading is taken again, up to five times, until half its bracket at the clock's rate is at most 0.25 universe seconds (READING_S): 0.5 s of real time at rate 1, 0.05 s at rate 10. The two readings' error then stays within 0.5 s of the 1 s bound, and the rate over 2 s is known to within about 2.5%.Why a rate of 10. A rate change reaches the session's clock as late as the follower is slow to react, and that delay is carried at the old rate until the next jump. On a loaded host, at rate 60, that was 67 ms. At rate 10 the follower would have to be about 100 ms late to reach the 1 s bound. Jumps set the clock outright, so they carry no such offset.
Left out of FD-5482's scope, and where each part is covered
date, Python, Chromium'sDate.nowand the driver on universe time across many jumps, a rate change and a freeze; input and screenshots after each jumpclock_desktop_test(30 jumps; the clock page written as the follower writes it)chromium_universe_test,egress_testclock_desktop_testtst/clockgatesget_timeon every callsync_timetakes no zone, so the multi env can't be armed in one; the zone is glibc'slocaltimeover the universe's UTCTesting
On the x86 host (local Docker):
call)So it adds about 5 s to the test, against its roughly 300 s in CI, most of which is the deploy.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Extends the existing computer clock test across jumps, rate changes, freezing, follower recovery, and reset.
Reviews (8) · Last reviewed commit: "test(computers): each clock reading's br..." · Reviewed by Greptile