Skip to content

fix(core): skip Nx Console and AI agents checks in CI and speed up e2e browser and port helpers - #37119

Draft
FrozenPandaz wants to merge 4 commits into
e2e-shared-base-workspacefrom
fix/skip-nx-console-check-without-tty
Draft

FrozenPandaz wants to merge 4 commits into
e2e-shared-base-workspacefrom
fix/skip-nx-console-check-without-tty

Conversation

@FrozenPandaz

@FrozenPandaz FrozenPandaz commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Stacked on #35964 (e2e-shared-base-workspace). Merge that first; this PR then retargets to master.

This PR has 4 commits, each reviewable on its own:

  1. fix(core): skip the Nx Console and AI agents checks when their result can't be shown
  2. chore(repo): split runE2ETests into shouldRunCypressTests and shouldRunPlaywrightTests
  3. chore(repo): stop waiting a fixed 5s for e2e ports to close
  4. chore(repo): log how long killPort takes to close a port

Current Behavior

Nx Console / AI agents checks

Every new daemon primes the Nx Console and AI agents status caches in the background. Both install nx@latest into a temp dir (~2s of package-manager work).

  • The CLI also asks the daemon for the Nx Console status on every command, even without a TTY, where the prompt can never show.
  • The daemon restarts on every lockfile change (LOCK_FILES_CHANGED), so any flow that installs packages (e.g. generators that add dependencies) pays for another nx@latest install running next to the next command.
  • The "Your AI agent configuration is outdated" hint prints in CI too.

e2e helpers

  • runE2ETests() without an argument prepares both Cypress and Playwright. 60 calls used that form, but none needs both browsers. The module federation v2 suites (vite/rsbuild/rspack) only serve and need neither, yet paid ~30s for the first cypress verify on a fresh machine.
  • killPort always sleeps 5s after killing a port before checking it.
  • None of these steps log how long they take, so slow e2e runs can't be broken down from CI logs.

Expected Behavior

Nx Console / AI agents checks

  • CLI: only asks for the Nx Console status when there is a TTY and it is not CI.
  • Daemon: skips priming the Nx Console and AI agents caches in CI (it inherits CI from the client that spawned it).
  • Task runner: skips the "AI agent configuration is outdated" hint in CI.
  • Local interactive behavior (TTY, no CI) is unchanged.

e2e helpers

  • runE2ETests is replaced by shouldRunCypressTests() and shouldRunPlaywrightTests(). Each prepares only its own browser and logs Cypress ready (Ns) / Playwright ready (Ns).
  • Every call site uses the helper for the browser its guarded code actually runs (audited per call site: 0 needed both).
  • The module federation v2 suites no longer gate serve; CI already sets NX_E2E_RUN_E2E.
  • killPort polls every 100ms (still gives up after 5s) and logs how long closing took.

Measured locally:

Before After
nx@latest pulls per daemon start with CI=true 1 0
No-install nx g on a warm daemon with CI=true 0.84–0.89s 0.57–0.58s
killPort on a busy port 5.0s ~0.2s
MF v2 vite suite (jest) 52–80s 30.7s

Related Issue(s)

N/A


View Polygraph session ↗

@netlify

netlify Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 930d023
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6aaf6859beafe00008f02aaf
😎 Deploy Preview https://deploy-preview-37119--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 930d023
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6aaf68594ffffa000810a2f1
😎 Deploy Preview https://deploy-preview-37119--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 930d023

Command Status Duration Result
nx affected --targets=lint,oxlint,test,build,e2... ✅ Succeeded 40m 41s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 1m 1s View ↗
nx build workspace-plugin ✅ Succeeded 2m 38s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 15s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx affected -t e2e-macos-local --parallel=2 --b... ✅ Succeeded 31m 28s View ↗

☁️ Nx Cloud last updated this comment at 2026-09-20 05:48:59 UTC

nx-cloud[bot]

This comment was marked as outdated.

@FrozenPandaz
FrozenPandaz force-pushed the fix/skip-nx-console-check-without-tty branch from 482caf3 to 5845897 Compare September 19, 2026 15:05
@FrozenPandaz FrozenPandaz changed the title fix(core): skip Nx Console and AI agents checks when they cannot be shown fix(core): skip Nx Console and AI agents checks in CI and speed up e2e browser and port helpers Sep 19, 2026
@FrozenPandaz
FrozenPandaz changed the base branch from master to e2e-shared-base-workspace September 19, 2026 15:07
@FrozenPandaz
FrozenPandaz added this pull request to stack #37120 September 19, 2026 15:07
@FrozenPandaz
FrozenPandaz force-pushed the fix/skip-nx-console-check-without-tty branch from 5845897 to f0f10d0 Compare September 19, 2026 15:54
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@FrozenPandaz
FrozenPandaz force-pushed the fix/skip-nx-console-check-without-tty branch 3 times, most recently from a6a510d to c67e524 Compare September 19, 2026 17:46
@FrozenPandaz
FrozenPandaz force-pushed the fix/skip-nx-console-check-without-tty branch from c67e524 to 8cdd88f Compare September 19, 2026 21:24

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz
FrozenPandaz force-pushed the fix/skip-nx-console-check-without-tty branch 2 times, most recently from 1adeed5 to 300a746 Compare September 20, 2026 04:56
…hown

Every new daemon primed the Nx Console and AI agents status caches, and
both install nx@latest into a temp dir. The CLI also asked for the Nx
Console status on every command, even without a TTY. In CI neither result
is ever shown, but the daemon restarts on every lockfile change, so each
restart paid for another nx@latest install running next to the command.

- CLI: only ask for the Nx Console status with a TTY outside CI
- daemon: skip priming both caches in CI
- task runner: skip the "AI agent configuration is outdated" hint in CI

A no-install generate on a warm daemon with CI=true drops from ~0.87s to
~0.58s locally.
…unPlaywrightTests

runE2ETests() without an argument prepared both Cypress and Playwright,
and 60 of its calls used that form although none needs both browsers.
The module federation v2 suites needed neither, yet paid ~30s for the
first `cypress verify` on a fresh machine.

- Replace it with one helper per browser that prepares only that browser
  and logs how long it took.
- Move every call to the helper for the browser its guarded code runs.
- Drop the guard in the module federation v2 suites so `serve` always
  runs; CI already sets NX_E2E_RUN_E2E.
killPort slept 5s after killing a port before checking it. Poll every
100ms instead, still giving up after 5s. A busy port now closes in
~0.2s locally.
@FrozenPandaz
FrozenPandaz force-pushed the fix/skip-nx-console-check-without-tty branch from 300a746 to 930d023 Compare September 20, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant