Skip to content

ci(integration): shorten the longest integration jobs - #367

Draft
earakely-scale wants to merge 3 commits into
mainfrom
test/share-trigger-env
Draft

earakely-scale wants to merge 3 commits into
mainfrom
test/share-trigger-env

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Why

After the slow tier went to eight runners, the longest integration jobs on main were the fast tier, integration-local, at 15.9 minutes, and the two gateway shards at 12.8 and 11.9 minutes. The slow shards took 5.5–8.8 minutes. Most of that time goes to deploys rather than to the tests themselves.

What

  • The trigger tests deploy once. The five tests in test_register_env_triggers_local.py share one deployed items env and its registry, made by a module fixture, suite.
    • A per-test fixture, items_env, returns the env to the state a fresh deploy leaves it in:
      • POST /triggers/clear removes triggers, events, watch roles, executors and config.
      • POST /clock/clear stops the clock.
      • The env's data/reset empties the items.
    • The trajectory is append-only, so the delay-and-hours test reads only the lines added after it starts.
    • The stack setup in local_parallel_deploy_test.py moves into a context manager, local_stack_at, which a module can hold for all its tests. local_stack still gives one test its own.
  • Two fast-tier files move to the slow tier. env/envs/server_env_local_test.py and openenv/build_app_test.py deploy envs in nearly every test. They ran first in the fast tier, on a cold image cache, and took about 8.6 of its minutes. They are now int_test_slow, as the marker's definition says: real Docker builds and deploys. In the slow shards, where earlier modules have warmed the image cache, they take 72 and 79 seconds.
  • The gateway tests run on three runners, not two: integration-local-gateway (1/3) to (3/3). The required checks keep their names.
  • slow_durations.json is refreshed from this branch's own run (40642453175), so the shards balance with the moved files and the new trigger times.

Tests

CI on this branch, compared with main at f6ae9cc:

Job main This branch
integration-local (fast tier) 15.9 min 5.6 min
integration-local-gateway shards 11.9, 12.8 min 9.5, 8.7, 9.8 min
integration-local-slow shards 5.5–8.8 min 6.4–8.2 min

The longest integration job goes from 15.9 to 9.8 minutes. unit (7.5 minutes) is unchanged.

The trigger tests on their own, on a 4-vCPU Ubuntu 24.04 VM set up as the slow-tier job sets up its runner:

Run Time Result
main, warm image cache 268 s, 50–59 s per test 5 passed
This branch, warm 89 s: 43 s for the one deploy, 5–16 s per test 5 passed
This branch, the five tests in reverse order 89 s 5 passed
This branch, followed by local_parallel_deploy_test.py in the same session 154 s 6 passed

No test containers were left behind after any run. ruff check and tst/unit/test_shards.py pass.

🤖 Generated with Claude Code

earakely-scale and others added 2 commits October 27, 2026 22:45
Each of the five tests in test_register_env_triggers_local.py deployed its
own items env and registry. They now share one per module, which a
per-test fixture returns to a fresh deploy's state: /triggers/clear,
/clock/clear and data/reset. local_stack_at lets a module hold the stack
local_stack gives a single test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… and run the gateway tests on three runners

server_env_local_test.py and openenv/build_app_test.py deploy envs in nearly
every test and took about 8.6 of the fast tier's 15.5 minutes, which made it
the longest job. They are now int_test_slow, so the eight slow shards share
them. The gateway tests, the longest job after that, run on three runners
instead of two.

The table weighs the moved files by their times in the fast tier on main,
and the trigger tests by their time now, until a refresh from CI's reports.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@earakely-scale earakely-scale changed the title test(integration): deploy once per module in the slow tier ci(integration): shorten the longest integration jobs Oct 28, 2026
… run

From the JUnit reports of run 40642453175, which ran the moved files and the
shared-env trigger tests in the slow shards and the gateway tests on three.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

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