Skip to content

fix(computers): the ubuntu-24.04 desktop's panel clock redraws when the universe clock is armed or jumps - #806

Open
earakely-scale wants to merge 12 commits into
mainfrom
edgararakelyan/fd-6318-panel-clock-redraw
Open

earakely-scale wants to merge 12 commits into
mainfrom
edgararakelyan/fd-6318-panel-clock-redraw

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Collaborator

Why

The ubuntu-24.04 desktop's panel clock showed the real date for up to a minute after the universe clock was armed. An agent's first screenshots could show Nov 2026 next to sites dated Feb 2027 (FD-6318, found in an audit of a PSI computer task's run).

XFCE's clock plugin redraws on a minute timer of its own. That timer runs on real time (GLib's timeouts are monotonic, which agent-env's libfaketime keeps real), so:

  • an armed clock or a jump shows on the panel only when the timer next fires, up to a minute later;
  • the timer keeps its old phase, so the universe's next minute (or midnight) shows late by as much again.

Measured on the base: after a jump to 23:59:35, the panel kept the old date for 35 s past the universe's midnight.

What

The base's session runs a new program, clock-panel, on real time (the clock's real-time marker). It reads the clock page the follower writes. When the universe moves by a second or more, or its rate changes (arming, set_time, advance, set_rate, clear), it has each clock on the panel redraw:

  • at once;
  • again at the universe's next minute, after which the plugin's own timer is back in phase;
  • while the rate isn't 1, at every universe minute, at most once a second, since the plugin's timer runs on real seconds.

The follower re-anchoring on a new offset (sub-second) redraws nothing.

A redraw sets the clock plugin's timezone to the local zone's name, then resets it. The plugin redraws on each change, in any clock mode, and the panel's config ends as it was. A clock given a zone of its own is left alone.

Why a session program rather than the follower: the follower runs as agentenv-clock and can't reach the session's D-Bus (where xfconf lives), by design. The other hooks the plugin has were worse:

  • logind's PrepareForSleep: no system bus here, and a stand-in logind would answer for every app;
  • a panel restart: maximized windows resize when the panel's strut goes and comes back;
  • toggling its format: a flash of seconds.

How it was tested

  • Unit (tst/unit/env/envs/test_computer_clock_panel.py): the program run as it runs on a computer, against a page written as the follower writes it and a recording xfconf-query. It checks:

    • arming and a jump redraw at once and again at the next universe minute;
    • a re-anchor redraws nothing;
    • rate 60 redraws once a second; frozen redraws nothing;
    • a clock with its own zone is left alone.
  • Integration (clock_desktop_test.py, new test): the clock desktop bundle gets a test app with AT-SPI's Python bindings. The test reads the panel's clock as an assistive technology does (its button is named by its date). After jumps a year on, years back and a week on, it must show the universe's date within 3 s, and it must turn at a universe midnight within 3 s. Without the program it's up to a minute.

  • By hand on the published base, on an admin VM, with the program under the session's supervisord: each jump showed on the panel in 0.15–0.44 s, and each universe midnight after a jump in 0.08–0.31 s. A 2 ms re-anchor redrew nothing, rate 60 redrew once a second, and frozen stopped.

  • The integration test on an admin VM (16-core Linux, local Docker, the branch's sources): the clock desktop composed with clock-panel in it, and both selected tests passed (-k "composed or panel", 9 minutes). The probe still passes at full, and the panel showed each jump's date and turned at the universe's midnight within the 3 s bound.

  • Chaos, about 30 minutes, on that composed image:

    • Control: with clock-panel stopped, 3 s after a jump the panel still showed the old date. Started again, it caught up in 0.1 s.
    • 12 jumps 50 ms apart: the panel ended on the last date in 0.4 s.
    • clock-panel killed just before a jump: supervisord restarted it and the date showed in 1.33 s.
    • The panel restarted (xfce4-panel --restart) with a jump during the restart: 0.48 s, and 0.45 s for the next jump.
    • xfconfd killed, then a jump: xfconf-query started it again over D-Bus, 0.45 s.
    • A torn page (seq left odd): no crash; the next write showed in 0.16 s.
    • A clock given its own zone (Asia/Tokyo) is left alone and lags, as before. Once its zone was reset, a jump showed in 0.45 s.
    • Three universe midnights after jumps to 4 s before them each turned in 0.08–0.36 s.
    • A clear went back to the real date in 0.45 s.
    • A computer in Europe/Paris turned at Paris's midnight in 0.36 s.
    • The panel's xfconf channel was identical before and after: 21 redraws, no errors logged.

A clock given a zone of its own still lags as before. Redrawing it would need a value equivalent to its zone, which xfconf doesn't offer, and nothing in agent-env sets one.

Also: a composed disk no longer waits on a base disk

Changing the base means no published base or base disk matches its sources until a release publishes them, on this PR and on main after it. For each disk a slow-tier shard composed, the composer first made a whole disk of the base:

  • the base's root filesystem written into a 16 GB disk and exported as an image;
  • then converted back to raw so the composed disk could cut out its 64 MiB EFI system partition.

That partition and the disk's size are all a composed disk takes from its base disk. The partition is the boot recipe's own uki stage, which doesn't depend on the base. On CI's runners the base-disk step took 4 to over 10 minutes and pushed the website-browser fixture past the 20-minute limit.

The composer now builds the composed disk with the recipe's partition at the base's size (SIZE_GB, no ESP) and makes no base disk. The disk's key is unchanged (container key, base identity, recipe), and a base with a disk image or a published one still gives its partition as before.

  • Unit: test_computer_disk.py now checks that no base disk is built and that each disk gets SIZE_GB and no ESP. 43 passed.
  • Integration, on the admin VM with KVM: disk_test.py and disk_boot_test.py, 4 passed. disk_boot_test composed the shipped desktop's disk this way (no base disk made), booted it under KVM, passed the probe at full, reset it and passed again.
  • Timing on the VM, cold cache: the base disk took 19 s to write and 24 s to export, beyond its kernel stage; the composed disk made from it took 132 s. The kernel stage (apt) is common to both paths. Today it took 31 minutes because Ubuntu's archive was degraded, which is also why this run's and main's slow shards timed out at the same time.

Also: a shorter slow tier

On main's last green run the slow tier's shards took 7–17 minutes, and the longest set the run's time. Five changes, all in tests or CI but the disk one above:

  1. Fixtures compose containers only, as agent-env run does for local Docker (Composing.for_run). Every computer fixture used to compose every form of its base: the container and the disk, the native ones probed by gate 3. That's about 2 more minutes per fixture to build a disk and boot it under KVM, though only the launcher's tests boot a fixture's disk image. Now:
    • a test that deploys the disk form composes it first, as a run's deploy does (chromium_app_test's [disk] case);
    • the launcher's tests and the Modal disk tests take desktop_with_disk, which composes the disk too.
  2. A fixture composes no computer app alone but its own. A fixture whose bundle puts agentenv's chromium on a desktop also composed chromium alone, its own browser computer: 2–10 minutes per such shard, though those fixtures never deploy it alone. While a fixture writes its bundle, composer.compose now skips any computer app but the fixture's target. The browser computer fixture's target is chromium alone, so it still composes it.
    • I first made this change in agent-env run itself. Greptile showed that loses a run's --no-emulate and its retry of a failed app build, so it's reverted and lives in the fixtures only. Nothing in src/ changes what a run or a register composes.
  3. split_in splits a long file across shards. A shard runs a file's tests together, and chromium_app_test (15 minutes on main), browser_multi_env_test (14) and browser_computer_test (14) are each longer than the rest of a shard's load. The durations table can now name a file in split_in, which cuts it into that many runs of neighbouring tests. Each run after the first is charged the setup of the file's module fixtures, which its runner does again. These three are cut in two.
  4. Each shard runs its heaviest files first. pytest-xdist's loadfile hands a worker the next file in collected order, so a long file collected last started last. One shard held 20 minutes of tests and took 13.4.
  5. The table is refreshed from these changes. Each unit gets its longer time over two runs of test(ci): measure the slow tier with #806's CI changes alone #812. A file that reused a computer another file on its shard had composed had looked short: browser_clock_test weighed 2 minutes on main and took 8 where it composed chromium alone first.

Measured on #812, a draft of main plus these changes alone, with no change to the base. Every run below was green; times are the Local backends run's wall time and its slow shards.

Run Changes Wall Slow shards
main's last green, before these none about 17 min 7.3–16.6 min
#812, 09:50 1, 3, 5 as from main 17.7 min 6.4–17.5 (two shards waited on slow downloads)
#812, 10:16 + app composes in agent-env run (since reverted) 14.3 min 7.2–14.1
#812, 11:20 1–5 as in this PR 12.9 min 8.1–12.7

Shard times vary by a few minutes run to run with the network: a compose resolves packages from Ubuntu's archive, PyPI and Chrome for Testing's downloads. The same compose took 1m47 in one run and 8m03 in another. On 11-19 Ubuntu's archive was degraded for hours, which slowed main and these runs alike.

This PR's own CI is slower than that until a release publishes the changed base. Every shard here builds the ubuntu-24.04 base cold, and every disk compose builds its boot partition from Ubuntu's archive, with no published base disk to take it from. Its runs took 16–27 minutes.

Linear: FD-6318 (under FD-6206).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The changes reviewed appear safe to merge.

Summary

The PR makes the desktop panel clock follow universe-time changes promptly and reduces unnecessary disk builds and CI fixture work.

  • The Ubuntu desktop panel clock catches up when universe time changes.
  • Composed disks use the recipe’s partition when no base disk image is available.
  • Computer integration fixtures build disks only for tests that boot them.
  • Slow test shards split long files and start with their heaviest work.

No new actionable issues found in the changes since the previous review.

Reviews (11) · Last reviewed commit: "test(computers): a fixture composes no c..." · Reviewed by Greptile

earakely-scale and others added 2 commits November 18, 2026 21:41
…he universe clock is armed or jumps

XFCE's clock plugin redraws on a minute timer of its own, on real time, so after the universe clock was armed or
jumped the panel showed the old date and time for up to a minute, and its next minute late by as much again.
The base's session now runs clock-panel, on real time: it reads the clock page and, when the universe moves by a
second or more or its rate changes, has each panel clock redraw at once and again at the universe's next minute
(every universe minute, at most once a second, while the rate isn't 1). A redraw sets the plugin's time zone to the
local zone's name and resets it, which the plugin redraws on and which leaves the panel's config as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale marked this pull request as ready for review November 19, 2026 05:48
@earakely-scale
earakely-scale requested a review from a team as a code owner November 19, 2026 05:48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 5 commits November 18, 2026 21:56
…edraw is still redrawn

A clock whose zone is unset or the local zone's name shows local time either way, so clock-panel moves it to the
other and back: a redraw cut short between its two changes leaves it in one of the two, which the next redraw
handles, rather than on a zone later redraws took for the user's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and the desktop

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ipe's partition, with no base disk made

A computer's disk keeps only its base disk's EFI system partition and size. With no published base disk, as on
every run after the base's sources change until a release publishes them, the composer made a whole base disk
first: the base's root filesystem written into a 16 GB disk and exported, then converted back to raw so the
composed disk could cut out its 64 MiB partition. That took 4 to over 10 minutes on CI's runners, enough to time
out the slow tier's composing fixtures. The composed disk now takes the recipe's own partition (its uki stage) at
the base's size, which is what the made base disk held; the disk's key is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… does, its containers alone

Each computer fixture composed every form of its base: the container and the disk of each arch, the native ones
probed by gate 3, though only the launcher's tests boot a fixture's disk image. Building and booting a disk added
about 2 minutes to each of the slow tier's fixtures. They now compose as `agent-env run` does for local Docker
(Composing.for_run), so a test that deploys the disk form composes it first, as a run's deploy would; the launcher's
tests (and the Modal disk tests) take desktop_with_disk, which composes the disk too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ach, and refresh the durations table

Each slow-tier shard ran a file's tests together, so the three longest files, chromium_app_test (about 15
minutes on main), browser_multi_env_test (14) and browser_computer_test (14), each held a shard to at least
that long whatever the rest weighed. The durations table can now name a file in split_in, which cuts it into
that many runs of neighbouring tests, each charged the setup of the file's module fixtures that its runner
does anew, and these three are cut in two. With main's latest green run's times, rewritten into the table by
slow_test_durations.py from all of its JUnit reports, the slowest shard of twelve goes from 14.8 to 11.9
minutes of tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… boots it alone

A computer app env that names a computer and a driver, as agentenv's chromium does, was composed alone whenever a
bundle wrote it, though most runs deploy it only on a desktop, which composes it into its own image. A run's
compose now leaves it to the first deploy that boots it alone (compose_unstarted), as it leaves a form no deploy
boots; a register, with or without a --sandbox, still composes it, since others deploy what it writes. In CI,
composing chromium alone took 2 to 10 minutes in each shard whose fixtures used it only as a desktop's app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 3 commits November 19, 2026 02:32
pytest-xdist's loadfile hands a worker the next file as it frees, in collected order, so a shard whose longest
file was collected last ran it last: shard 10 of a run held 20 minutes of tests, about 10 for each of its two
workers, and took 13.4, its 7-minute run_bundle_claude_code_test starting late. The shard hook now orders a
shard's files by the seconds the durations table gives them, heaviest first, each file's tests together in their
collected order, which packs the two workers as evenly as the files allow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uns of the new fixtures

The durations table was main's, whose fixtures composed disks and every app alone, and where a file that reused
a computer another file on its shard had composed looked short: browser_clock_test weighed 2 minutes and took 8
on a shard where it composed chromium alone first. The table is now each unit's longer time over two runs of
these changes (#812's 44504100677 and 44506657938), each written by slow_test_durations.py from all of a run's
JUnit reports, so a file is weighed as it costs where it composes its own computers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A computer app that names a computer and a driver, as agentenv's chromium does, was composed alone by every
fixture whose bundle put it on a desktop, though those fixtures deploy it only on the desktop, which composes it
into its own image: 2 to 10 minutes of each such shard. While a fixture writes its bundle, composer.compose now
composes no computer app alone but the fixture's own (env_id, as the browser computer fixture's is chromium), or
every one with disks; a test that deploys another alone has its deploy compose it first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

@greptileai review

This branch has not been deployed

No deployments
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