fix(utils): prevent race condition in parallel plugin runs#1222
Merged
BioPhoton merged 3 commits intocode-pushup:mainfrom Jan 20, 2026
Merged
fix(utils): prevent race condition in parallel plugin runs#1222BioPhoton merged 3 commits intocode-pushup:mainfrom
BioPhoton merged 3 commits intocode-pushup:mainfrom
Conversation
When running the same plugin for multiple projects in parallel (e.g., via Nx targets), the timestamp-based directory naming could collide if two processes started within the same millisecond. This caused one process to delete the output directory while another was still using it, leading to failures. The fix adds process.pid and a random suffix to the directory name, ensuring uniqueness even when multiple processes run simultaneously.
|
View your CI Pipeline Execution ↗ for commit 49d8341
☁️ Nx Cloud last updated this comment at |
@code-pushup/ci
@code-pushup/cli
@code-pushup/core
@code-pushup/create-cli
@code-pushup/models
@code-pushup/nx-plugin
@code-pushup/axe-plugin
@code-pushup/eslint-plugin
@code-pushup/coverage-plugin
@code-pushup/js-packages-plugin
@code-pushup/jsdocs-plugin
@code-pushup/lighthouse-plugin
@code-pushup/typescript-plugin
@code-pushup/utils
commit: |
Contributor
Code PushUp🤨 Code PushUp report has both improvements and regressions – compared current commit 1d7ffda with previous commit 1d7ffda. 🏷️ Categories👎 1 group regressed, 👍 1 audit improved, 👎 4 audits regressed, 13 audits changed without impacting score🗃️ Groups
33 other groups are unchanged. 🛡️ Audits661 other audits are unchanged. |
Contributor
vmasek
approved these changes
Jan 19, 2026
vincent-capicotto-payfit
approved these changes
Jan 20, 2026
BioPhoton
approved these changes
Jan 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a race condition when running the same plugin for multiple projects in parallel (e.g., via Nx targets).
Problem
When two processes started within the same millisecond, the timestamp-based directory naming in
createRunnerFileswould collide:This caused one process to delete the output directory (in
executeRunnerConfig) while another was still using it, leading to failures.Solution
Added
process.pidand a random suffix to the directory name to ensure uniqueness:This ensures that even when multiple processes run simultaneously, each gets its own unique working directory.