Skip to content

👷 parallelize test app builds#4567

Open
BenoitZugmeyer wants to merge 1 commit intomainfrom
benoit/parallelize-test-app-builds
Open

👷 parallelize test app builds#4567
BenoitZugmeyer wants to merge 1 commit intomainfrom
benoit/parallelize-test-app-builds

Conversation

@BenoitZugmeyer
Copy link
Copy Markdown
Member

Motivation

yarn build:apps builds all test apps sequentially, making it slow (~1m22s on a typical machine). Since most apps are independent, they can be built in parallel.

Changes

  • Add runAsync() to the command builder (async spawn-based counterpart to run()), with a mutex that automatically serializes git commands to avoid index lock conflicts
  • Rewrite build-test-apps.ts to build all apps concurrently using a dependency-aware ensureBuild() function; react-router-v7-app waits on react-router-v6-app, and the two extensions wait on base-extension
  • Update the secureCommandExecution ESLint rule to accept .runAsync() as a valid terminal call

Wall-clock time drops from ~1m22s to ~37s (~2x faster).

Test instructions

Run yarn build:apps and verify all apps build successfully.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented May 6, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 179.65 KiB 179.65 KiB 0 B 0.00%
Rum Profiler 6.17 KiB 6.17 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.78 KiB 56.78 KiB 0 B 0.00%
Rum Slim 135.50 KiB 135.50 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.004 0.0068 +70.00%
RUM - add action 0.0138 0.0188 +36.23%
RUM - add error 0.013 0.0188 +44.62%
RUM - add timing 0.0028 0.0041 +46.43%
RUM - start view 0.0127 0.0176 +38.58%
RUM - start/stop session replay recording 0.0007 0.0008 +14.29%
Logs - log message 0.0144 0.0191 +32.64%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.90 KiB 30.95 KiB -974 B
RUM - add action 58.38 KiB 59.60 KiB +1.22 KiB
RUM - add timing 32.49 KiB 32.22 KiB -279 B
RUM - add error 59.66 KiB 63.63 KiB +3.97 KiB
RUM - start/stop session replay recording 32.28 KiB 31.19 KiB -1.09 KiB
RUM - start view 484.73 KiB 485.93 KiB +1.20 KiB
Logs - log message 111.39 KiB 104.68 KiB -6.71 KiB

🔗 RealWorld

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/parallelize-test-app-builds branch from ea3e54c to 2e6a2d1 Compare May 6, 2026 16:12
@datadog-prod-us1-4
Copy link
Copy Markdown

datadog-prod-us1-4 Bot commented May 6, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.02% (+0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2e3c7f8 | Docs | Datadog PR Page | Give us feedback!

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/parallelize-test-app-builds branch from 2e6a2d1 to e819ee5 Compare May 7, 2026 09:52
Add `runAsync()` to the `command` builder and use it in `build-test-apps.ts`
to build all apps concurrently. Dependencies are resolved via a memoized
`ensureBuild()` function that waits for each app's deps before starting it.
Git commands are automatically serialized via a mutex to avoid index lock
conflicts. Reduces wall-clock build time from ~1m22s to ~37s.
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/parallelize-test-app-builds branch from e819ee5 to 2e3c7f8 Compare May 7, 2026 09:59
@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review May 7, 2026 09:59
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner May 7, 2026 09:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e3c7f84e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lib/command.ts
Comment on lines +98 to +102
const child = childProcess.spawn(commandName, commandArguments, {
env: { ...process.env, ...env },
...extraOptions,
stdio: 'pipe',
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor withInput() when running asynchronously

When callers use the new runAsync() path with withInput() (for example the existing gh auth login --with-token/ssh-add - patterns if they are converted to async), the configured input is never written to the spawned process. Because spawn() creates a stdin pipe here but the parent neither writes nor closes it, commands that read from stdin can hang indefinitely or fail with missing input, unlike run() which passes input to spawnSync().

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, but we'll fix when we need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants