Cache what every CI job rebuilt, and fetch no map tiles in tests (#1033) #1083

Merged
tiagoagueda merged 1 commit from 1033-ci-workers into main 2026-10-31 02:10:03 +00:00
Owner

Items 2, 3, 6 and 7 of the CI review, now that item 1 runs CI once per
push instead of three times and the host carries one browser and one unit
job at a time.

  • The browser job runs on two xdist workers (-n 2 --dist worksteal), the
    unit job on three, in both ci.yml and every-python.yml: five workers on
    six cores. The comments say why two browser workers failed before (run
    723, under three CI runs and a dev image), and that #1024's file-backed
    live-server database was not on main when this changed. Three measured
    green runs decide whether it stays.
  • The compiled catalogues are kept between runs, by an exact key over
    every .po, the compiler, the language table and the version; the browser,
    unit and PostgreSQL jobs compile only on a miss.
  • Checks clones with filter: blob:none: the guard reads trees for the
    changed paths and fetches the few catalogues it reads. Forgejo
    advertises filter, and the repository is readable without a token.
  • Chromium's libraries and fonts, as Playwright 1.62's --with-deps lists
    them for Debian 12 (bar xvfb), join WeasyPrint's in one apt run, and
    playwright install chromium drops --with-deps. Not --only-shell:
    test_web_app.py starts the full Chromium.
  • The heavy step names tests/security/test_markdown.py instead of
    collecting the whole suite; a test holds every file with a heavy test to
    that list.
  • The test settings draw the map's outline and fetch no tiles; the tests
    about the tiles ask for OpenStreetMap with a new openstreetmap
    fixture.

Refs #1033

Notes for review

Draft until three measured green CI runs, as #1033 asks for items 2 and 3. Each run's wall time and job times get recorded in this PR before it merges.

  • Item 2: browser job -n 2 --dist worksteal. The earlier failures under two workers (run 723) came with three CI runs per push and the dev image on the same host, and that load is gone since #1072. #1024's file-backed live-server database (#1074) wasn't on main when this changed.
  • Item 3: unit job -n 3, in both ci.yml and every-python.yml.
  • Item 6:
    • the compiled catalogues are cached on an exact key over every .po and the tool;
    • the Checks job clones blobless (filter: blob:none; Forgejo advertises it);
    • Chromium's libraries install in the WeasyPrint apt step, with xvfb left out and the fonts kept.
  • Item 7:
    • the heavy step names its file, and a test keeps that list honest;
    • tests draw the map with no tiles (POSTULO_MAP_TILES = "none"), with an openstreetmap fixture for the tests that are about tiles.
  • Proven only by a CI run: the cache's hit rate and whether the checkout action accepts the blobless filter.

🤖 Generated with Claude Code

Items 2, 3, 6 and 7 of the CI review, now that item 1 runs CI once per push instead of three times and the host carries one browser and one unit job at a time. - The browser job runs on two xdist workers (`-n 2 --dist worksteal`), the unit job on three, in both ci.yml and every-python.yml: five workers on six cores. The comments say why two browser workers failed before (run 723, under three CI runs and a dev image), and that #1024's file-backed live-server database was not on main when this changed. Three measured green runs decide whether it stays. - The compiled catalogues are kept between runs, by an exact key over every .po, the compiler, the language table and the version; the browser, unit and PostgreSQL jobs compile only on a miss. - Checks clones with `filter: blob:none`: the guard reads trees for the changed paths and fetches the few catalogues it reads. Forgejo advertises `filter`, and the repository is readable without a token. - Chromium's libraries and fonts, as Playwright 1.62's `--with-deps` lists them for Debian 12 (bar xvfb), join WeasyPrint's in one apt run, and `playwright install chromium` drops `--with-deps`. Not `--only-shell`: test_web_app.py starts the full Chromium. - The heavy step names tests/security/test_markdown.py instead of collecting the whole suite; a test holds every file with a heavy test to that list. - The test settings draw the map's outline and fetch no tiles; the tests about the tiles ask for OpenStreetMap with a new `openstreetmap` fixture. Refs #1033 ## Notes for review **Draft until three measured green CI runs,** as #1033 asks for items 2 and 3. Each run's wall time and job times get recorded in this PR before it merges. - **Item 2:** browser job `-n 2 --dist worksteal`. The earlier failures under two workers (run 723) came with three CI runs per push and the dev image on the same host, and that load is gone since #1072. #1024's file-backed live-server database (#1074) wasn't on `main` when this changed. - **Item 3:** unit job `-n 3`, in both `ci.yml` and `every-python.yml`. - **Item 6:** - the compiled catalogues are cached on an exact key over every `.po` and the tool; - the Checks job clones blobless (`filter: blob:none`; Forgejo advertises it); - Chromium's libraries install in the WeasyPrint apt step, with xvfb left out and the fonts kept. - **Item 7:** - the heavy step names its file, and a test keeps that list honest; - tests draw the map with no tiles (`POSTULO_MAP_TILES = "none"`), with an `openstreetmap` fixture for the tests that are about tiles. - **Proven only by a CI run:** the cache's hit rate and whether the checkout action accepts the blobless filter. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Run CI's browser tests on two workers and its unit tests on three (#1033)
Some checks failed
CI / Unit tests and coverage (Python 3.14) (pull_request) Failing after 15m46s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 1m27s
CI / Browser tests (Chromium) (pull_request) Successful in 23m42s
CI / Security audit (pull_request) Successful in 1m20s
CI / Database tests on PostgreSQL (pull_request) Successful in 5m0s
2a6fa3b94c
Items 2, 3, 6 and 7 of the CI review, now that item 1 runs CI once per
push instead of three times and the host carries one browser and one unit
job at a time.

- The browser job runs on two xdist workers (`-n 2 --dist worksteal`), the
  unit job on three, in both ci.yml and every-python.yml: five workers on
  six cores. The comments say why two browser workers failed before (run
  723, under three CI runs and a dev image), and that #1024's file-backed
  live-server database was not on main when this changed. Three measured
  green runs decide whether it stays.
- The compiled catalogues are kept between runs, by an exact key over
  every .po, the compiler, the language table and the version; the browser,
  unit and PostgreSQL jobs compile only on a miss.
- Checks clones with `filter: blob:none`: the guard reads trees for the
  changed paths and fetches the few catalogues it reads. Forgejo
  advertises `filter`, and the repository is readable without a token.
- Chromium's libraries and fonts, as Playwright 1.62's `--with-deps` lists
  them for Debian 12 (bar xvfb), join WeasyPrint's in one apt run, and
  `playwright install chromium` drops `--with-deps`. Not `--only-shell`:
  test_web_app.py starts the full Chromium.
- The heavy step names tests/security/test_markdown.py instead of
  collecting the whole suite; a test holds every file with a heavy test to
  that list.
- The test settings draw the map's outline and fetch no tiles; the tests
  about the tiles ask for OpenStreetMap with a new `openstreetmap`
  fixture.

Refs #1033

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Measured run 1 (run 1658): the browser job on two workers was green.

Unit job on three workers: failed, and the cause is memory, not the tests. The kernel killed two of the three workers at the same second ([gw1]/[gw2] node down: Not properly terminated, about 75 % through). xdist then reported whichever tests they were holding. The job container is capped at 2 GB and each worker grows towards 1 GB (#830), so three don't fit.

The unit job is now back on two workers. Item 3 stays open: it needs either a larger memory cap on the runner's job container (a host setting) or finding what makes each worker grow (for example the full-catalogue loads in test_translations.py). The same memory pressure likely explains #1079's browser job being killed with exit 137.

Still to go: two more measured green runs for item 2.

**Measured run 1 (run 1658):** the browser job on two workers was green. **Unit job on three workers: failed, and the cause is memory, not the tests.** The kernel killed two of the three workers at the same second (`[gw1]`/`[gw2] node down: Not properly terminated`, about 75 % through). xdist then reported whichever tests they were holding. The job container is capped at 2 GB and each worker grows towards 1 GB (#830), so three don't fit. The unit job is now back on **two** workers. **Item 3 stays open**: it needs either a larger memory cap on the runner's job container (a host setting) or finding what makes each worker grow (for example the full-catalogue loads in `test_translations.py`). The same memory pressure likely explains #1079's browser job being killed with exit 137. Still to go: two more measured green runs for item 2.
tiagoagueda force-pushed 1033-ci-workers from 2a6fa3b94c
Some checks failed
CI / Unit tests and coverage (Python 3.14) (pull_request) Failing after 15m46s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 1m27s
CI / Browser tests (Chromium) (pull_request) Successful in 23m42s
CI / Security audit (pull_request) Successful in 1m20s
CI / Database tests on PostgreSQL (pull_request) Successful in 5m0s
to 26d8bad31f
Some checks failed
CI / Browser tests (Chromium) (pull_request) Has been cancelled
CI / Unit tests and coverage (Python 3.14) (pull_request) Has been cancelled
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Has been cancelled
CI / Database tests on PostgreSQL (pull_request) Has been cancelled
CI / Security audit (pull_request) Has been cancelled
2026-10-29 10:03:39 +00:00
Compare
tiagoagueda force-pushed 1033-ci-workers from 26d8bad31f
Some checks failed
CI / Browser tests (Chromium) (pull_request) Has been cancelled
CI / Unit tests and coverage (Python 3.14) (pull_request) Has been cancelled
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Has been cancelled
CI / Database tests on PostgreSQL (pull_request) Has been cancelled
CI / Security audit (pull_request) Has been cancelled
to d3579afbaa
All checks were successful
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 14m28s
CI / Browser tests (Chromium) (pull_request) Successful in 24m0s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 1m58s
CI / Security audit (pull_request) Successful in 2m0s
CI / Database tests on PostgreSQL (pull_request) Successful in 6m35s
2026-10-29 10:32:33 +00:00
Compare
Author
Owner

Measured run 2 (run 1691, commit d3579afba): green.

Job Time
Browser tests (two workers) 24m 0s
Unit tests and coverage (two workers) 14m 28s
Database tests on PostgreSQL 6m 35s
Checks 1m 58s
Security audit 2m 0s

For comparison, the browser suite took 33 to 42 minutes in one process on 27 and 28 October. One more measured green run to go.

**Measured run 2 (run 1691, commit d3579afba): green.** | Job | Time | |---|---| | Browser tests (two workers) | 24m 0s | | Unit tests and coverage (two workers) | 14m 28s | | Database tests on PostgreSQL | 6m 35s | | Checks | 1m 58s | | Security audit | 2m 0s | For comparison, the browser suite took 33 to 42 minutes in one process on 27 and 28 October. One more measured green run to go.
tiagoagueda force-pushed 1033-ci-workers from d3579afbaa
All checks were successful
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 14m28s
CI / Browser tests (Chromium) (pull_request) Successful in 24m0s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 1m58s
CI / Security audit (pull_request) Successful in 2m0s
CI / Database tests on PostgreSQL (pull_request) Successful in 6m35s
to 4e5d547e13
Some checks failed
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 23m20s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 2m28s
CI / Database tests on PostgreSQL (pull_request) Successful in 5m29s
CI / Security audit (pull_request) Successful in 1m44s
CI / Browser tests (Chromium) (pull_request) Failing after 38m24s
2026-10-30 20:53:26 +00:00
Compare
Author
Owner

Measured run 3 (commit 4e5d547e1, after #1085 put the unit job on three workers): red. The browser job on two workers failed four layout and timing tests: test_target_size, test_site_search scripts-off panel, test_board_fold long column at 640, and test_every_page phone dark. All four passed when run again alone. The job took 32 minutes against 24 on run 2. There were no database errors; this is CPU contention, with three unit workers, two browser workers and the PostgreSQL job on one six-core host.

Item 2 fails its measurement. The browser step goes back to one process. Items 6 and 7 stay: the translation cache, the blobless checkout, the Chromium libraries, the heavy step by path, and no map tiles in tests. This PR then stops being a draft.

**Measured run 3 (commit 4e5d547e1, after #1085 put the unit job on three workers): red.** The browser job on two workers failed four layout and timing tests: `test_target_size`, `test_site_search` scripts-off panel, `test_board_fold` long column at 640, and `test_every_page` phone dark. All four passed when run again alone. The job took 32 minutes against 24 on run 2. There were no database errors; this is CPU contention, with three unit workers, two browser workers and the PostgreSQL job on one six-core host. **Item 2 fails its measurement.** The browser step goes back to one process. Items 6 and 7 stay: the translation cache, the blobless checkout, the Chromium libraries, the heavy step by path, and no map tiles in tests. This PR then stops being a draft.
tiagoagueda changed title from WIP: Run the browser suite on two workers and the unit suite on three, and trim CI's setup (#1033) to Cache what every CI job rebuilt, and fetch no map tiles in tests (#1033) 2026-10-30 21:42:02 +00:00
tiagoagueda force-pushed 1033-ci-workers from 4e5d547e13
Some checks failed
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 23m20s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 2m28s
CI / Database tests on PostgreSQL (pull_request) Successful in 5m29s
CI / Security audit (pull_request) Successful in 1m44s
CI / Browser tests (Chromium) (pull_request) Failing after 38m24s
to 7f064bfd47
All checks were successful
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 14m43s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 1m55s
CI / Database tests on PostgreSQL (pull_request) Successful in 4m53s
CI / Security audit (pull_request) Successful in 1m24s
CI / Browser tests (Chromium) (pull_request) Successful in 38m23s
2026-10-30 21:42:03 +00:00
Compare
tiagoagueda deleted branch 1033-ci-workers 2026-10-31 02:10:03 +00:00
Sign in to join this conversation.
No reviewers
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
Postulo/postulo!1083
No description provided.