[PR #179] Why Automated Checks Suddenly Took Longer: The Process Waited Minutes After the Tests Finished
The free time available for CI (a service that runs checks automatically when code is pushed) was shrinking fast. I requested an analysis, and Claude read the usage records, the run history and the per-step logs to find the cause. This PR was done by Claude Sonnet 5.5 alone in a cloud session.
- What was done:
- Finding the cause: runs had become more frequent and each check took longer. Comparing per-step times showed the biggest waste: after the app tests (Jest) finished, the process did not close and waited several more minutes. Earlier run logs did not show that wait.
- Stopping the wait: the app’s
testcommand now has--forceExit(an option that forcibly closes the process when tests finish). Locally the app tests finished in 16 seconds. - Verification blocked in the work environment: in the cloud session, the device that automatically runs verification when work is about to end (a Stop hook) was blocked every time by server test failures. The server tests need Docker (a tool that runs programs in isolated boxes), which that environment does not have.
- Methods chosen and alternatives dropped:
--forceExitonly masks the symptom. It hides unclosed timers or connections, so why the process does not close stays unresolved. The PR says plainly that it is a stopgap and the cause remains.- Without Docker, run the verification minus the server tests. If that passes, it also shows a notice that the server tests were not run. With Docker, the full verification runs as before.
- Dropped alternatives: skipping the device entirely would leave zero verification. A flag in an environment variable saying “CI verifies, so skip” does not fit periods when CI is not running.
- How it was checked:
- Usage records (CSV) were summed by month, workflow (a bundle of automated checks) and user to find what grew.
- Step times in the logs showed a gap of about 5 minutes between the end of the app tests and the start of the server tests.
- Running the device with real input made the verification without server tests pass and print the notice. For the Docker case, Docker was started in this session and
npm run verifywas run directly and passed, not through the device. - The whole app test suite passed locally.
- The full browser-flow test (
npm run e2e) could not launch because the browser version preinstalled in this environment differed from the one the project requires. With a temporary setting outside the repository pointing to the preinstalled browser, all 5 tests passed. No repository file was changed.
At a glance
| Problem | What was done | What remains |
|---|---|---|
| App tests finish but the process waits minutes | Stopped the wait with --forceExit |
Why it does not close (open timers or connections) is still unknown |
| End-of-work verification blocked every time without Docker | Run verification minus server tests and say so | Server tests cannot run in that environment |
Who did what
- I: requested the analysis.
- Claude (cloud session, Claude Sonnet 5.5): analyzed the records, stopped the wait, changed the verification device and checked it.
What was not verified
- Whether another test configuration for the app has the same wait.
- Whether the browser install taking 8 minutes once was a one-off. Earlier records show 20 seconds.
What I learned
- Looking for the gap between when the tests end and when the next step starts reveals waiting, not test time.
- A forced-exit option hides the cause, so when you use one, write down that the cause remains.
- A verification minus the server tests is a copy of the original, and it drifts unless it is edited along with the original.
- In an environment missing a tool, do not skip verification; run what you can and say what you could not.