CI, perf gates, deploy and rollback #11

Open
opened 2026-10-13 15:01:16 +00:00 by kayg · 5 comments
Owner

CI, perf gates, deploy and rollback (ADR 0005, 0008, 0032).

  • CI with build caching; per-PR gates: tests, fuzz suite, perf on the perf VM (median of N, noise bands, auto-rerun).
  • Rootless podman image, quadlet on the calternal-cloud VM.
  • Deploy keeps the previous version warm, health checks, automatic rollback, admin "Roll back"; lock handover; additive data changes only.
  • Hosts: preview (mockups), next (dev build on a copy of v0 data), calternal.cloud (cutover later).
CI, perf gates, deploy and rollback (ADR 0005, 0008, 0032). - CI with build caching; per-PR gates: tests, fuzz suite, perf on the perf VM (median of N, noise bands, auto-rerun). - Rootless podman image, quadlet on the calternal-cloud VM. - Deploy keeps the previous version warm, health checks, automatic rollback, admin "Roll back"; lock handover; additive data changes only. - Hosts: preview (mockups), next (dev build on a copy of v0 data), calternal.cloud (cutover later).
Author
Owner

Progress: next.calternal.cloud runs the dev build (PR #47, CI green). Deploy and rollback scripts live in deploy/next/. A deliberately broken build was rolled back automatically: declared unhealthy after 60 s, the earlier build was live again 10 s later, data restored from the pre-deploy snapshot.

Progress: next.calternal.cloud runs the dev build (PR #47, CI green). Deploy and rollback scripts live in deploy/next/. A deliberately broken build was rolled back automatically: declared unhealthy after 60 s, the earlier build was live again 10 s later, data restored from the pre-deploy snapshot.
Author
Owner

Web e2e job: why it was red, what changed, numbers (PR #236)

What a web job actually got (before)

  • The job containers ran in system.slice, which had the same weight as user.slice. The agents' CPUWeight=20 sits on user-1001.slice, which is the only slice under user.slice, so it changed nothing.
  • A web job on a busy machine (task 297) got a median of 2.8 cores (p90 6.6), and its tasks waited for the CPU 54% of the time. Memory peaked at 8.4 GB, which was never the limit.
  • Playwright ran 6 workers (half of the 12 cores it can see), and two web jobs ran at once.

The WebKit failures: neither a WebKit bug in the app nor plain starvation

  • In the container, WebKit composites the glass (backdrop blur) with Mesa's software GL (llvmpipe). Each shader is compiled on first use, on the compositor's single thread. A cold cache meant a page's first frame took 8.8–9.8 s at 1440 and 4.4 s at 390. With backdrop-filter off it took 0.33 s. Giving it 4 or 12 cores didn't help (top -H: one ThreadedCompositor thread at 100%).
  • With a warm cache (a volume kept between runs) the first frame takes 2.5 s at 1440 and 0.25 s at 390.
  • With the glass open (Info, toasts), frames still take 1–3 s each on a busy machine. Several WebKit pages at once starved each other until toasts timed out before they could be clicked.
  • Run alone on an idle CI container, the failing WebKit specs passed: 28/28, 10 s per test on average.
  • Real Safari composites on the GPU, so it never pays this cost.

Changes

Machine (calternal-dev), documented in ci/README.md, unit files in ci/host/:

  • /etc/systemd/system/ci.slice with CPUWeight=1000. When the machine is busy, CI gets 10 parts in 12 of the CPU against the agents. When it's idle, nothing changes.
  • Main runner /var/lib/forgejo-runner/config.yml: container.options: --cgroup-parent=ci.slice, new allowed volume calternal-mesa-cache, capacity 2. The original config is backed up as config.yml.bak-issue11.
  • New web-only runner forgejo-runner-web.service (label web, capacity 1, config in /var/lib/forgejo-runner-web/, --cpu-shares=8192, so cgroup weight 532 against the rust job's 100).
  • Drop-in graceful.conf (TimeoutStopSec=30min) for both runners, so a restart lets running jobs finish instead of killing them after 90 s.

Repo:

  • The web job runs-on: web and needs: server (a small job that only builds the binary). Its tests no longer wait on format, lint or Rust tests.
  • Every job has a timeout. The Mesa cache volume is mounted.
  • Playwright on CI: 4 workers, WebKit one test at a time per width, and @throttled (CPU ×4/×6) tests alone after the rest.
  • The settings tests and the contrast check each get a server and a person of their own.
  • All ports come from the OS, in the web, primitives and mockup configs, and no config reuses a server it finds already running. There's one app build per run instead of four.
  • still() replaces fixed sleeps. press() in the shortcut tests reads only its own key (it used to read ⌥'s or an earlier key's answer). ⌘⇧; is checked in a day note of the test's own. hidden-cost.test.ts measures CPU time instead of the wall clock.

Numbers: the full suite in the CI image, on this machine while agents built (host load 70–120)

run failed / passed wall
as CI was 29 / 107 (21 of the failures in WebKit 1440) 11.5 min
ci.slice + 4 workers + isolation 3–8 / 126–131 4.9–5.8 min
+ warm shader cache 1–5 / 129–133 4.7–5.2 min
+ WebKit 1440 at most 2 0 / 150 5.6 min
+ contrast isolated, WebKit 1440 alone 0 / 151 8.6 min
+ WebKit one per width 0 / 151 7.9 min

Average test time for WebKit 1440: 41 s → 16 s → 9 s. For WebKit 390: 15.8 s → 5.0 s.

On CI, #147 run 103 had a green web job: 150 passed, 0 failed, 7.3 min, running beside another web job still on the old config.

Not proven yet: three green CI runs in a row

The proof PR (#237: the same commits on dev at dff1833, before dev went red) is queued. The forge's whole queue is backed up: about 15 open PRs have had jobs pending since 09:26. Branches still on the old workflow run their web jobs on the main runner, 10+ minutes each. Two Rust jobs hung while holding the shared cargo lock (an rust-lld deadlocked on a futex for 45 minutes, and a calternal_notes test ran for 33 minutes), and I killed both. Every earlier proof run that failed failed for one of these reasons: a web job beside two old-config web jobs got 2.9 cores, or a run waited for a rust job that never started. None failed because a test was wrong. #236 removes the cause for every branch that's on it.

Real failures that stay red (not this issue)

  • pwa-update.spec.ts "a reload after a deploy shows the new version" (#164) fails every time, including alone on one worker: the old shell-… cache is still there 60 s after the reload.
  • cargo fmt on dev: crates/notes/src/tests.rs module order.
  • A probable race: the Info sheet's plain mentions can read the search index before it has caught up, and never re-read it.
## Web e2e job: why it was red, what changed, numbers (PR #236) ### What a web job actually got (before) - The job containers ran in `system.slice`, which had the same weight as `user.slice`. The agents' `CPUWeight=20` sits on `user-1001.slice`, which is the only slice under `user.slice`, so it changed nothing. - A web job on a busy machine (task 297) got a median of 2.8 cores (p90 6.6), and its tasks waited for the CPU 54% of the time. Memory peaked at 8.4 GB, which was never the limit. - Playwright ran 6 workers (half of the 12 cores it can see), and two web jobs ran at once. ### The WebKit failures: neither a WebKit bug in the app nor plain starvation - In the container, WebKit composites the glass (backdrop blur) with Mesa's software GL (llvmpipe). Each shader is compiled on first use, on the compositor's single thread. A cold cache meant a page's first frame took **8.8–9.8 s at 1440 and 4.4 s at 390**. With `backdrop-filter` off it took 0.33 s. Giving it 4 or 12 cores didn't help (`top -H`: one `ThreadedCompositor` thread at 100%). - With a warm cache (a volume kept between runs) the first frame takes **2.5 s at 1440 and 0.25 s at 390**. - With the glass open (Info, toasts), frames still take 1–3 s each on a busy machine. Several WebKit pages at once starved each other until toasts timed out before they could be clicked. - Run alone on an idle CI container, the failing WebKit specs passed: 28/28, 10 s per test on average. - Real Safari composites on the GPU, so it never pays this cost. ### Changes **Machine (calternal-dev), documented in `ci/README.md`, unit files in `ci/host/`:** - `/etc/systemd/system/ci.slice` with `CPUWeight=1000`. When the machine is busy, CI gets 10 parts in 12 of the CPU against the agents. When it's idle, nothing changes. - Main runner `/var/lib/forgejo-runner/config.yml`: `container.options: --cgroup-parent=ci.slice`, new allowed volume `calternal-mesa-cache`, capacity 2. The original config is backed up as `config.yml.bak-issue11`. - New web-only runner `forgejo-runner-web.service` (label `web`, capacity 1, config in `/var/lib/forgejo-runner-web/`, `--cpu-shares=8192`, so cgroup weight 532 against the rust job's 100). - Drop-in `graceful.conf` (`TimeoutStopSec=30min`) for both runners, so a restart lets running jobs finish instead of killing them after 90 s. **Repo:** - The web job `runs-on: web` and `needs: server` (a small job that only builds the binary). Its tests no longer wait on format, lint or Rust tests. - Every job has a timeout. The Mesa cache volume is mounted. - Playwright on CI: 4 workers, WebKit one test at a time per width, and `@throttled` (CPU ×4/×6) tests alone after the rest. - The settings tests and the contrast check each get a server and a person of their own. - All ports come from the OS, in the web, primitives and mockup configs, and no config reuses a server it finds already running. There's one app build per run instead of four. - `still()` replaces fixed sleeps. `press()` in the shortcut tests reads only its own key (it used to read ⌥'s or an earlier key's answer). ⌘⇧; is checked in a day note of the test's own. `hidden-cost.test.ts` measures CPU time instead of the wall clock. ### Numbers: the full suite in the CI image, on this machine while agents built (host load 70–120) | run | failed / passed | wall | |---|---|---| | as CI was | 29 / 107 (21 of the failures in WebKit 1440) | 11.5 min | | ci.slice + 4 workers + isolation | 3–8 / 126–131 | 4.9–5.8 min | | + warm shader cache | 1–5 / 129–133 | 4.7–5.2 min | | + WebKit 1440 at most 2 | 0 / 150 | 5.6 min | | + contrast isolated, WebKit 1440 alone | 0 / 151 | 8.6 min | | + WebKit one per width | **0 / 151** | 7.9 min | Average test time for WebKit 1440: 41 s → 16 s → 9 s. For WebKit 390: 15.8 s → 5.0 s. On CI, #147 run 103 had a green web job: 150 passed, 0 failed, 7.3 min, running beside another web job still on the old config. ### Not proven yet: three green CI runs in a row The proof PR (#237: the same commits on dev at `dff1833`, before dev went red) is queued. The forge's whole queue is backed up: about 15 open PRs have had jobs pending since 09:26. Branches still on the old workflow run their web jobs on the main runner, 10+ minutes each. Two Rust jobs hung while holding the shared cargo lock (an `rust-lld` deadlocked on a futex for 45 minutes, and a `calternal_notes` test ran for 33 minutes), and I killed both. Every earlier proof run that failed failed for one of these reasons: a web job beside two old-config web jobs got 2.9 cores, or a run waited for a rust job that never started. None failed because a test was wrong. #236 removes the cause for every branch that's on it. ### Real failures that stay red (not this issue) - `pwa-update.spec.ts` "a reload after a deploy shows the new version" (#164) fails every time, including alone on one worker: the old `shell-…` cache is still there 60 s after the reload. - `cargo fmt` on dev: `crates/notes/src/tests.rs` module order. - A probable race: the Info sheet's plain mentions can read the search index before it has caught up, and never re-read it.
Author
Owner

Update: the final PR is now #259; it replaces #236. The proof PR is #260; it replaces #237.

needs: server doesn't work on this forge (16.0.5). On #236 and #237 the server job succeeded at 11:41 and 11:43, and both web jobs were still pending at 11:53 with the web runner idle. This is the same behaviour that made the workflow drop needs the first time. The web job therefore waits for the server job's binary inside the job again: up to 40 minutes, and a failed build ends the wait at once. The separate server job and the job timeouts stay. The proof loop is now running on #260.

Update: the final PR is now **#259**; it replaces #236. The proof PR is **#260**; it replaces #237. `needs: server` doesn't work on this forge (16.0.5). On #236 and #237 the server job succeeded at 11:41 and 11:43, and both web jobs were still pending at 11:53 with the web runner idle. This is the same behaviour that made the workflow drop `needs` the first time. The web job therefore waits for the server job's binary inside the job again: up to 40 minutes, and a failed build ends the wait at once. The separate `server` job and the job timeouts stay. The proof loop is now running on #260.
Author
Owner

Proof runs on #260 (the #259 commits on dev at dff1833)

I ran 8 runs back to back while the agents were building. The queue moved again after I killed two hung Rust jobs.

run web job what failed
198 failure primitives, WebKit toasts: WebKit crashed
203 failure primitives, WebKit toast: WebKit crashed
205 failure primitives, WebKit toast: WebKit crashed
206 failure shortcuts.spec Chromium: ⌘B wrapped --- at the start of the doc, not the selected word
208 success: 151 passed, 4.8 min
209 failure shortcuts.spec Chromium: ⌘⌥1 put # on ---, not on the line the caret was on
211 success: 151 passed, 5.4 min
213 success: 151 passed, 5.0 min

Three green runs, but not three in a row: the last two are consecutive. No run failed on a timeout or on starvation. The failures are two real bugs, neither of them in the CI setup:

  1. WebKit's compositor crashes. The kernel log shows ThreadedCompositor segfaulting at address 0 in libWPEWebKit-2.0.so.1.12.0, while the primitives toast tests run (glass toasts, software GL). It happened 14 times since yesterday 17:00, long before the shader cache or any change here, so it is not caused by this PR. Playwright's WebKit on Linux has the bug, triggered by the toasts. The suite is right to fail on it. It needs its own issue: either a smaller repro to report upstream, or a different toast glass in the WebKit build.
  2. The editor loses the selection when a remote change arrives. The test sets a selection on a word and presses ⌘B (or ⌘⌥1). The edit lands at the start of the document (**---, # ---), so the selection was reset to position 0. That fits the server's frontmatter rewrite (the calternal-id and dates) arriving as a whole-document replace right after the note opens, instead of a change the selection can follow. People could hit this too, typing just after opening a note. It needs its own issue.

Both are real failures, and the suite should keep failing on them.

## Proof runs on #260 (the #259 commits on dev at `dff1833`) I ran 8 runs back to back while the agents were building. The queue moved again after I killed two hung Rust jobs. | run | web job | what failed | |---|---|---| | 198 | failure | primitives, WebKit toasts: **WebKit crashed** | | 203 | failure | primitives, WebKit toast: **WebKit crashed** | | 205 | failure | primitives, WebKit toast: **WebKit crashed** | | 206 | failure | `shortcuts.spec` Chromium: ⌘B wrapped `---` at the start of the doc, not the selected word | | 208 | **success**: 151 passed, 4.8 min | | | 209 | failure | `shortcuts.spec` Chromium: ⌘⌥1 put `# ` on `---`, not on the line the caret was on | | 211 | **success**: 151 passed, 5.4 min | | | 213 | **success**: 151 passed, 5.0 min | | Three green runs, but not three in a row: the last two are consecutive. No run failed on a timeout or on starvation. The failures are two real bugs, neither of them in the CI setup: 1. **WebKit's compositor crashes.** The kernel log shows `ThreadedCompositor` segfaulting at address 0 in `libWPEWebKit-2.0.so.1.12.0`, while the primitives toast tests run (glass toasts, software GL). It happened 14 times since yesterday 17:00, long before the shader cache or any change here, so it is not caused by this PR. Playwright's WebKit on Linux has the bug, triggered by the toasts. The suite is right to fail on it. It needs its own issue: either a smaller repro to report upstream, or a different toast glass in the WebKit build. 2. **The editor loses the selection when a remote change arrives.** The test sets a selection on a word and presses ⌘B (or ⌘⌥1). The edit lands at the start of the document (`**---`, `# ---`), so the selection was reset to position 0. That fits the server's frontmatter rewrite (the `calternal-id` and dates) arriving as a whole-document replace right after the note opens, instead of a change the selection can follow. People could hit this too, typing just after opening a note. It needs its own issue. Both are real failures, and the suite should keep failing on them.
Author
Owner

ADR 0003 evidence migration: ci/README.md

Source commit: 102e841889d113d39c09fd3093185b599ef702e2; snapshot from dev 55f35fcd. Full original source preserved below before repository removal/stripping. Design, code and test inputs are retained where applicable.

# CI

CI runs on `calternal-dev`, the same machine the agents build on (12 cores, 62 GB). Two Forgejo
runners (systemd services) run each job in a Docker container: `forgejo-runner` (label `docker`,
two at a time) takes `rust` (build, lint, tests), and `forgejo-runner-web` (label `web`, one at a
time) takes `web` (typecheck, unit tests, browser tests in Chromium and WebKit). The workflow is [.forgejo/workflows/ci.yml](<../.forgejo/workflows/ci.yml>); the images
are built on the host from [rust.Dockerfile](<rust.Dockerfile>) and [web.Dockerfile](<web.Dockerfile>).

The browser tests must pass when the code is right, even while eight agents compile beside them,
and fail when it isn't. What that takes, and why:

## CI comes first on the machine

Every job container goes in `ci.slice` with CPU weight 1000, next to the agents (`user.slice`,
100) and services (`system.slice`, 100). When the machine is busy, CI gets 10 parts in 12 of the
CPU; when it's idle, CI and the agents both use every core. A weight, not a reservation, so
nothing sits idle.

Before this, job containers sat in `system.slice` at the same weight as all the agents together
(the agents' `CPUWeight=20` was on `user-1001.slice`, the only slice under `user.slice`, so it
changed nothing). A web job got a median 3.8 cores on a busy machine, and its browsers waited for
the CPU 45% of the time.

Set up once on the host:

- [host/ci.slice](<host/ci.slice>) installed as `/etc/systemd/system/ci.slice`, then
  `systemctl daemon-reload`.
- In the runner's `/var/lib/forgejo-runner/config.yml`, under `container:`:
  `options: --cgroup-parent=ci.slice`, and the shader cache volume (below) added to
  `valid_volumes`.
- [host/graceful.conf](<host/graceful.conf>) as a drop-in for both runner services
  (`/etc/systemd/system/forgejo-runner{,-web}.service.d/`): on a restart the runner waits for
  running jobs to finish, and systemd's default of 90 s would kill them first. Then
  `systemctl restart forgejo-runner`.

## One web job at a time

Two web jobs at once (two PRs pushed close together) split CI's share between eight browsers, and
WebKit's software drawing (below) slowed until toasts timed out before they could be clicked. The
web job has its own runner with capacity 1:
[host/forgejo-runner-web.service](<host/forgejo-runner-web.service>), its config a copy of the main
runner's with `capacity: 1` and `options: --cgroup-parent=ci.slice --cpu-shares=8192` in
`/var/lib/forgejo-runner-web/`, registered for this repository with the label
`web:docker://data.forgejo.org/oci/node:22-bookworm`. The shares give the web job weight 532
against the rust job's 100 inside `ci.slice`: the browser tests are the ones that miss a deadline
when starved, a build only finishes later. The `server` job (the binary for the browser
tests) and the `rust` job (format, lint, tests) stay on the main runner, two at a time, so the
browser tests don't depend on format, lint and the Rust tests passing. The web job waits inside for
the binary (up to 40 minutes; a failed build ends the wait at once) rather than `needs: server`:
on this forge a job that needs another stays pending after it succeeds. Each job has a timeout, so
a hung one (a linker once deadlocked on a futex for 45 minutes holding the shared cargo lock)
fails instead of holding everyone's queue. The forge does not hand out queued jobs oldest first,
so when many PRs push at once a run can still wait a long time to start.

## WebKit's shader cache stays warm

The glass (backdrop blur) makes WebKit on Linux composite with OpenGL, which in a container is
Mesa's software renderer, llvmpipe. Each shader is compiled the first time it's used, on the
compositor's one thread: with a cold cache a page's first frame took ~9 s at 1440 wide and ~4 s at
390, whatever the number of cores, and every test step that waits for a frame waited with it. The
cache lives in the `calternal-mesa-cache` volume (`MESA_SHADER_CACHE_DIR`), so only the first run
after a Mesa or WebKit upgrade pays. Warm, the first frame takes ~2.5 s at 1440 and ~0.25 s at
390. Real Safari composites on the GPU and never pays this.

## The browser tests, sized to what they get

In [apps/web/playwright.config.ts](<../apps/web/playwright.config.ts>):

- One app worker on CI, as in the browser trains. Its projects share a vault, live list updates,
  and a served shell that update tests rewrite; separate browser contexts do not isolate those
  resources. Parallel cases can move another case's rows or change its screenshot. The complete
  matrix still runs, with a three-hour job deadline and immediate assertion reporting. The
  independent primitives harness keeps four workers.
- WebKit one test at a time per width (1440 and 390; one in the primitives). Its frames with the
  glass open (Info, toasts) took 1–3 s each on a busy machine; more at once starved each other
  until toasts timed out before they could be clicked. Alone, a WebKit 1440 test averages 10 s
  instead of 16, and Chromium runs beside it.
- Tests that slow the browser's CPU on purpose (`@throttled`, the layout-shift checks at 4× and
  6×) run after everything else, one at a time, so the slowdown is the one they ask for.
- Tests that can't share a person have a server and a person of their own, one test at a time:
  the settings tests (`prefs-*`; settings are live on every page of a person, and flipping the
  theme repainted, and stalled, every other test's pages) and the contrast check (`contrast`; it
  photographs the lists, and other tests' new notes moved the rows under it).
- Every server listens on a port the system picks, so runs side by side (two CI jobs, agents
  running the tests locally) never meet, and none reuses a server someone else started.
- The app is built once for all the servers of a run, not four times at once.
- Tests wait for the screen to be still (`still()` in `e2e/helpers.ts`), never for a fixed time.

## Watching it

- Runner logs: `sudo journalctl -u forgejo-runner -o cat`.
- What a job gets, live: `cat /sys/fs/cgroup/ci.slice/docker-*.scope/cpu.stat` (and
  `cpu.pressure`, `memory.peak`).

ADR 0003 evidence migration: `ci/README.md` Source commit: [102e841889d113d39c09fd3093185b599ef702e2](https://git.kayg.org/kayg/calternal/commit/102e841889d113d39c09fd3093185b599ef702e2); snapshot from dev `55f35fcd`. Full original source preserved below before repository removal/stripping. Design, code and test inputs are retained where applicable. ```text # CI CI runs on `calternal-dev`, the same machine the agents build on (12 cores, 62 GB). Two Forgejo runners (systemd services) run each job in a Docker container: `forgejo-runner` (label `docker`, two at a time) takes `rust` (build, lint, tests), and `forgejo-runner-web` (label `web`, one at a time) takes `web` (typecheck, unit tests, browser tests in Chromium and WebKit). The workflow is [.forgejo/workflows/ci.yml](<../.forgejo/workflows/ci.yml>); the images are built on the host from [rust.Dockerfile](<rust.Dockerfile>) and [web.Dockerfile](<web.Dockerfile>). The browser tests must pass when the code is right, even while eight agents compile beside them, and fail when it isn't. What that takes, and why: ## CI comes first on the machine Every job container goes in `ci.slice` with CPU weight 1000, next to the agents (`user.slice`, 100) and services (`system.slice`, 100). When the machine is busy, CI gets 10 parts in 12 of the CPU; when it's idle, CI and the agents both use every core. A weight, not a reservation, so nothing sits idle. Before this, job containers sat in `system.slice` at the same weight as all the agents together (the agents' `CPUWeight=20` was on `user-1001.slice`, the only slice under `user.slice`, so it changed nothing). A web job got a median 3.8 cores on a busy machine, and its browsers waited for the CPU 45% of the time. Set up once on the host: - [host/ci.slice](<host/ci.slice>) installed as `/etc/systemd/system/ci.slice`, then `systemctl daemon-reload`. - In the runner's `/var/lib/forgejo-runner/config.yml`, under `container:`: `options: --cgroup-parent=ci.slice`, and the shader cache volume (below) added to `valid_volumes`. - [host/graceful.conf](<host/graceful.conf>) as a drop-in for both runner services (`/etc/systemd/system/forgejo-runner{,-web}.service.d/`): on a restart the runner waits for running jobs to finish, and systemd's default of 90 s would kill them first. Then `systemctl restart forgejo-runner`. ## One web job at a time Two web jobs at once (two PRs pushed close together) split CI's share between eight browsers, and WebKit's software drawing (below) slowed until toasts timed out before they could be clicked. The web job has its own runner with capacity 1: [host/forgejo-runner-web.service](<host/forgejo-runner-web.service>), its config a copy of the main runner's with `capacity: 1` and `options: --cgroup-parent=ci.slice --cpu-shares=8192` in `/var/lib/forgejo-runner-web/`, registered for this repository with the label `web:docker://data.forgejo.org/oci/node:22-bookworm`. The shares give the web job weight 532 against the rust job's 100 inside `ci.slice`: the browser tests are the ones that miss a deadline when starved, a build only finishes later. The `server` job (the binary for the browser tests) and the `rust` job (format, lint, tests) stay on the main runner, two at a time, so the browser tests don't depend on format, lint and the Rust tests passing. The web job waits inside for the binary (up to 40 minutes; a failed build ends the wait at once) rather than `needs: server`: on this forge a job that needs another stays pending after it succeeds. Each job has a timeout, so a hung one (a linker once deadlocked on a futex for 45 minutes holding the shared cargo lock) fails instead of holding everyone's queue. The forge does not hand out queued jobs oldest first, so when many PRs push at once a run can still wait a long time to start. ## WebKit's shader cache stays warm The glass (backdrop blur) makes WebKit on Linux composite with OpenGL, which in a container is Mesa's software renderer, llvmpipe. Each shader is compiled the first time it's used, on the compositor's one thread: with a cold cache a page's first frame took ~9 s at 1440 wide and ~4 s at 390, whatever the number of cores, and every test step that waits for a frame waited with it. The cache lives in the `calternal-mesa-cache` volume (`MESA_SHADER_CACHE_DIR`), so only the first run after a Mesa or WebKit upgrade pays. Warm, the first frame takes ~2.5 s at 1440 and ~0.25 s at 390. Real Safari composites on the GPU and never pays this. ## The browser tests, sized to what they get In [apps/web/playwright.config.ts](<../apps/web/playwright.config.ts>): - One app worker on CI, as in the browser trains. Its projects share a vault, live list updates, and a served shell that update tests rewrite; separate browser contexts do not isolate those resources. Parallel cases can move another case's rows or change its screenshot. The complete matrix still runs, with a three-hour job deadline and immediate assertion reporting. The independent primitives harness keeps four workers. - WebKit one test at a time per width (1440 and 390; one in the primitives). Its frames with the glass open (Info, toasts) took 1–3 s each on a busy machine; more at once starved each other until toasts timed out before they could be clicked. Alone, a WebKit 1440 test averages 10 s instead of 16, and Chromium runs beside it. - Tests that slow the browser's CPU on purpose (`@throttled`, the layout-shift checks at 4× and 6×) run after everything else, one at a time, so the slowdown is the one they ask for. - Tests that can't share a person have a server and a person of their own, one test at a time: the settings tests (`prefs-*`; settings are live on every page of a person, and flipping the theme repainted, and stalled, every other test's pages) and the contrast check (`contrast`; it photographs the lists, and other tests' new notes moved the rows under it). - Every server listens on a port the system picks, so runs side by side (two CI jobs, agents running the tests locally) never meet, and none reuses a server someone else started. - The app is built once for all the servers of a run, not four times at once. - Tests wait for the screen to be still (`still()` in `e2e/helpers.ts`), never for a fixed time. ## Watching it - Runner logs: `sudo journalctl -u forgejo-runner -o cat`. - What a job gets, live: `cat /sys/fs/cgroup/ci.slice/docker-*.scope/cpu.stat` (and `cpu.pressure`, `memory.peak`). ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#11
No description provided.