# CI Ran the Game at a Different Frame Rate

- URL: https://ironwright.dev/notes/earfh-ci-ran-at-a-different-frame-rate
- Published: 2026-11-06
- Series: Solo, Not Alone
- Author: Adam Powell, Ironwright
- Summary: Earfh's tests passed locally and failed the same 11 assertions on every CI run. Nine came from one missing command line flag. The other two came from a test helper that restored half of what it saved, and fixing that exposed a third gap that only the dev machine could see.

By 2026-11-06 every CI run on Earfh had failed the same 11 assertions, on `main` and on every pull request since #446. The full local suite on the same code passed, 341,091 assertions and 0 failures. A failure that is identical on every run is deterministic, so something about the runner was different, and the job was to find what.

There were two causes. Both were reproduced locally before anything was fixed, and both went into PR #448.

## Nine assertions and one flag

Nine of the failures were in the Forklift Operator's movement suite. The local command for the test runner passes `--fixed-fps 60` to Godot. The workflow did not.

Headless Godot without that flag paces physics by the wall clock. A headless frame is fast, so sixty physics ticks finish in a sliver of the time the game expects, and the Forklift Operator's 60 tick charge covered 5 px instead of 280. Every assertion about where the charge ended up failed.

The repo already knew about this trap. A stress tool's header comment says that without the flag "the engine paces physics to the wall clock and every frame times at ~16.6ms flat regardless of load". Nobody had carried the warning to the workflow file. Dropping the flag locally reproduced the nine failures exactly, which settled the cause in one run. The workflow now passes the flag, with a comment explaining the 5 px charge.

## Two assertions and a fresh profile

The other two failures were in `test_loadout_swap`, and they would not appear locally even in CI's suite order. The difference was the save profile. A CI runner starts from a fresh profile, where the starter gun is the rifle. The dev machine's save named the pistol.

An earlier suite, `test_price_visibility`, selects the pistol and then restores its save snapshot. The shared helper `TestCase.restore_save_state` put the save's fields back, but `WeaponManager` kept its own copy of the current weapon and still held the pistol. On the dev profile the save also said pistol, so the two agreed by accident. On the fresh profile the save said rifle and the manager said pistol, and the first suite that read both failed. Running the suites with the profile pointed at an empty folder brought the failures back locally. The helper now reselects the gun and melee when they differ from the restored save, and a harness self check covers it.

## The fix exposed a third gap

That resync cut the other way. The runner's per suite reset, `TestRunner._reset_melee_pick`, put the starter bat into `WeaponManager` and left the save alone. The dev profile's save names a lanyard whip. Once restores resynced, the first restore in a suite pulled the whip back, and `test_bowl` and `test_arcade_firing_modes` failed on the dev machine while CI's fresh profile stayed green. The reset now writes the save's pick too, with a second self check.

So each profile hid a different half of the problem. The fresh profile found the missing resync, and the dev profile found the divergence the harness had been relying on without saying so.

PR #448's first CI run was green at 341,100 assertions. The final proof was the full local suite at 341,120 assertions on the dev profile and a second CI run at 341,109 on the fresh runner, both with 0 failures. It merged that day, and the Tests workflow on `main` went green again.

## What I changed

When CI and local disagree on a fixed set of assertions, the first thing to diff is the command that runs them: flags, working directory, environment, profile. That check takes a minute, and here it found the cause of nine of the eleven failures before anyone read test code.

A green CI run is also now a merge gate next to the full local suite, a standing rule from this round. The local suite on the dev machine passed through all of this, and it was the runner's fresh profile and bare command line that showed what the suite depended on.

More on the game at [/games/earfh](/games/earfh), and the rest of this series at [/notes](/notes).
