GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Run some unit tests in parallel by henrymercer · Pull Request #3542 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Drop the --serial flag we pass to ava in favour of specifying which tests need to be run sequentially. These are typically ones which read and write environment variables. This speeds up the unit tests by 4x on my machine from ~24s to ~6s (measured fairly unscientifically by comparing 5 runs of each).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@henrymercer
Run some unit tests in parallel
675af55
@henrymercer
henrymercer requested a review from a team as a code owner March 4, 2026 11:49
Copilot AI review requested due to automatic review settings March 4, 2026 11:49
@github-actions github-actions Bot added the size/XXL May be extremely hard to review label Mar 4, 2026
Copilot started reviewing on behalf of henrymercer March 4, 2026 11:50
View session
Copilot AI reviewed Mar 4, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the AVA test configuration to allow parallel test execution, while explicitly marking tests that rely on shared mutable state (notably process.env) as sequential to preserve correctness.

Changes:

  • Remove the global --serial flag from the ava npm script to enable parallel test runs.
  • Convert many unit tests to test.serial(...) where they mutate environment variables or other shared state.
  • Regenerate corresponding compiled lib/* JavaScript artifacts to reflect package.json changes.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/workflow.test.ts Marks env-dependent workflow validation tests as serial.
src/util.test.ts Marks env-mutating util tests as serial (extra options, env var helpers, etc.).
src/upload-sarif.test.ts Marks SARIF upload macro tests and tmp-dir tests as serial.
src/trap-caching.test.ts Marks cache-related tests that touch env/event files as serial.
src/status-report.test.ts Marks status-report tests as serial to avoid env interference.
src/start-proxy/environment.test.ts Marks proxy environment tests as serial due to env mutations.
src/start-proxy.test.ts Marks start-proxy tests as serial (credentials/env/error-message behavior).
src/setup-codeql.test.ts Marks setup-codeql tests as serial (platform/env/toolcache stubbing).
src/overlay/status.test.ts Marks overlay cache status tests as serial (RUNNER_TEMP/cache stubbing).
src/overlay/index.test.ts Marks overlay change-file/cache-key tests as serial.
src/init.test.ts Marks tests that rely on shared env/stubs as serial.
src/init-action-post-helper.test.ts Marks init-post tests as serial (env-driven execution paths).
src/git-utils.test.ts Marks git-utils tests as serial (env + global stubbing of git helpers).
src/feature-flags/properties.test.ts Marks repository properties feature-flag tests as serial.
src/feature-flags.test.ts Marks feature flag tests as serial to avoid shared env/cache interference.
src/diff-informed-analysis-utils.test.ts Marks diff-informed analysis tests as serial.
src/dependency-caching.test.ts Marks dependency-caching tests as serial where env/stubs are involved.
src/database-upload.test.ts Marks database upload tests as serial (env + HTTP mocking).
src/cli-errors.test.ts Marks platform/arch stubbing tests as serial.
src/api-client.test.ts Marks API-client tests as serial.
src/analyze.test.ts Marks analyze status report test as serial.
src/analyses.test.ts Marks analysis-kinds and risk assessment tests as serial.
src/actions-util.test.ts Marks some actions-util tests as serial; further serialisation may be needed for github.context mutation.
package.json Removes ava --serial to allow parallel execution.
lib/upload-sarif-action.js Compiled output update (generated from TS / package changes).
lib/upload-sarif-action-post.js Compiled output update (generated).
lib/upload-lib.js Compiled output update (generated).
lib/start-proxy-action.js Compiled output update (generated).
lib/start-proxy-action-post.js Compiled output update (generated).
lib/setup-codeql-action.js Compiled output update (generated).
lib/resolve-environment-action.js Compiled output update (generated).
lib/init-action.js Compiled output update (generated).
lib/init-action-post.js Compiled output update (generated).
lib/autobuild-action.js Compiled output update (generated).
lib/analyze-action.js Compiled output update (generated).
lib/analyze-action-post.js Compiled output update (generated).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/actions-util.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/dependency-caching.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

github-advanced-security[bot]
github-advanced-security Bot found potential problems Mar 4, 2026
View reviewed changes
Comment thread src/start-proxy.test.ts Dismissed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy.test.ts Dismissed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy.test.ts Dismissed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy.test.ts Dismissed

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy.test.ts Dismissed

Uh oh!

There was an error while loading. Please reload this page.

henrymercer added 2 commits March 4, 2026 13:08
@henrymercer
Run more actions util tests serially
36148cc
@henrymercer
Fix test name
aae9418
Base automatically changed from henrymercer/overlay-status-record-job to main March 4, 2026 12:13
@henrymercer
Merge branch 'main' into henrymercer/parallel-unit-tests
8e17ec9
github-advanced-security[bot]
github-advanced-security Bot found potential problems Mar 4, 2026
View reviewed changes
Comment thread src/start-proxy.test.ts Dismissed

Uh oh!

There was an error while loading. Please reload this page.

@henrymercer
Merge remote-tracking branch 'origin/main' into henrymercer/parallel-…
6123416
…unit-tests
mbg
mbg approved these changes Mar 4, 2026
View reviewed changes

@mbg mbg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for preparing this change! I had noticed that the unit tests were taking an increasing long time to run and considered whether we should look into this.

Happy to approve if the CI passes. I trust that you didn't change any of the test code itself, and so haven't reviewed all individual tests to check that they are identical to before.

I have some thoughts on how we can further improve this, but let's discuss that elsewhere and outside the context of this PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

henrymercer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@henrymercer

henrymercer commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

I trust that you didn't change any of the test code itself

👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@henrymercer
henrymercer added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit b6dfacb Mar 4, 2026
244 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@henrymercer
henrymercer deleted the henrymercer/parallel-unit-tests branch March 4, 2026 16:23
This was referenced Mar 5, 2026
Merge main into releases/v4 #3551
Merged
Merge releases/v4 into releases/v3 #3553
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mbg mbg mbg approved these changes
+1 more reviewer
@github-advanced-security github-advanced-security[bot] github-advanced-security[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size/XXL May be extremely hard to review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@henrymercer @mbg @github-advanced-security
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.