Skip to content

test(computers): the session clock test compares each read with the universe's fixed offset, not the time after the last read - #704

Merged
earakely-scale merged 1 commit into
mainfrom
edgararakelyan/session-clock-test-waits-for-the-follower
Nov 16, 2026
Merged

earakely-scale merged 1 commit into
mainfrom
edgararakelyan/session-clock-test-waits-for-the-follower

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

base_computer_test::test_only_the_sessions_programs_read_universe_time_and_a_marked_one_real_time_but_not_what_it_starts arms the clock page from a known real instant, so the universe is exactly 182 days behind real time. It then compares each read's offset from real time, taken as that read returns, with those 182 days.

Why

The test flaked on main's slow tier (shard 10/12 on 11-14 twice and 11-15) and failed the CI that v0.9.1537's publish waits on, so that release never reached PyPI. Each time, the two universe reads (session, started by a marked one) read as real time while the three real-time reads passed.

The clock was fine; the test's arithmetic was off. It took back = universe - time.time() once, after all five docker exec reads, so a universe read was off by the time from the page's write to the end of the last read: six docker execs in all. On a busy runner (the slow tier runs under xdist) that passes the test's 5 s tolerance. Now a read is off only by the time its own docker exec took to return after date ran.

Testing

On an x86 host with local Docker, with a docker on PATH that sleeps 1 s before and after each docker exec, as a busy runner's are slow:

  • The test from main fails as CI did: {'session': False} != {'session': True} and {'started by a marked one': False} != {'started by a marked one': True}.
  • This branch's test passes, 6 runs out of 6.
  • Without the added latency, both pass.

ruff check is clean.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

This test-only change appears safe to merge.

Summary

The test now sets the universe clock from an explicit real-time anchor and compares each read against the fixed 182-day offset.

  • The clock test compares each read with its expected fixed time offset.

Reviews (1) · Last reviewed commit: "test(computers): the session clock test ..." · Reviewed by Greptile

…niverse's fixed offset, not the time after the last read

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 16, 2026 03:10
@earakely-scale
earakely-scale merged commit 67d5c0b into main Nov 16, 2026
35 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/session-clock-test-waits-for-the-follower branch November 16, 2026 03:59
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.

1 participant