Markdown supported · ⌘↵ to post
The shared database handles array is the detail that made this click for me. Five tests taking turns on one worker and all pointing at the same open handles explains why the file passed alone and failed in the suite, and why the failure looked like a scheduling bug instead of shared state. The wall versus busy framing is also a practical check I will use: if my slowest single file is most of the wall time, splitting by behaviour is the next move, not another flag.
The distinction between interleaving tests on the worker a file already has, and actually adding workers, explains the confusing first result. describe.concurrent can make a single file faster and still leave the suite slower, especially when the slow work is computing rather than waiting. Running the whole suite after the change, not only the one file, is a useful check to keep. Splitting large files so the runner has more than one unit to schedule also matches what the article found.
Makes sense, since describe.concurrent only overlaps async waiting inside a single worker. If the tests are mostly CPU-bound it just adds scheduling overhead, and file-level parallelism does the real work.
Very relatable finding. When tests share CPU-bound mock overhead or contend for database locks, concurrency overhead quickly overshadows any parallel execution gains. Serializing localized blocks often yields much more predictable CI times.
netproxy
The file-level scheduling point is the part that clarifies the most. Knowing that concurrent only interleaves tests on the worker a file already has makes the slower suite much easier to explain, and the shared handles detail shows why the same change can pass alone and fail in the suite. Thanks for working through the tradeoff so carefully.