This site's CI runs on my own desktop: a single self-hosted runner, with two workflows triggered by every push, "deploy" and "E2E tests". The runner can only run one job at a time, so normally things queue up for a bit and clear within a few minutes.
On the afternoon of 11/28 the queue suddenly grew to an hour. Several commits' deploys sat in queued, and every E2E ahead of them ran for nearly 60 minutes before ending, and failed.
First: is a test hanging?
My instinct was that some test was stuck waiting for a timeout. I pulled the log of one run:
15 million lines. A normal E2E log is a few thousand lines.
Then the timeline:
| Time | Event |
|---|---|
| 12:06:26 | Playwright starts |
| 12:13:55 | 168 passed (5.7m), 1 failure, process ends |
| 12:41:08 | the job is finally marked complete |
The tests finished in 7.5 minutes. For the 27 minutes after that, the runner was processing the log. It could do nothing else during that time, and every deploy behind it queued.
What the 15 million lines were
Almost all one warning, coming from the next dev that E2E starts:
That morning I had just added a mobile carousel of "latest posts" to the home page using the native CSS carousel: ::scroll-marker-group and ::scroll-marker let the browser draw the dots underneath itself, with zero JavaScript. Chrome supports them, but Lightning CSS, which Next.js uses to process CSS, does not recognize these two pseudo-elements yet.
In a production build it warns once and still outputs the rules, so the dots on the site were fine, and I noticed nothing while verifying. But next dev is different: every time it processes globals.css it prints the warning, with a few lines of source each time. With E2E running 170-odd tests and 3 workers constantly requesting pages, that added up to 450,000 prints.
The fix
1. Keep Lightning CSS away from those rules. I moved the carousel dot CSS out of globals.css and into the component, written as a string in a React 19 <style>:
href with precedence makes React hoist it into <head>, with only one copy per page. A string does not go through the CSS pipeline, so there is no warning. After the change, the CSS warnings in the build output went from 1 to 0, and the dots on phones display as before.
2. Make sure one job can never jam CI again. With a single runner, queueing itself cannot be avoided, but it can queue meaningfully:
Both jobs also got timeout-minutes: 30. GitHub's default limit is 6 hours, and a stuck job could hold the runner all afternoon.
What I learned
- Slow CI is not necessarily slow tests. Compare the "tests finished" time with the "job finished" time; a big gap means log processing.
- Log line count is a good alarm. Run
wc -l; if it jumps from a few thousand to millions, something is flooding it. - A clean build does not mean a clean dev server. The same warning prints once in a build and on every processing pass in dev. CI's E2E runs on dev.
- The toolchain may not keep up with new CSS features. The browser supports them, but processors like Lightning CSS or PostCSS may not yet. In that case you can let those rules bypass the processing pipeline.