Skip to content

test: optimize and stabilize e2e tests - #33813

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:test/e2e-performance-and-stability
Aug 7, 2026
Merged

test: optimize and stabilize e2e tests#33813
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:test/e2e-performance-and-stability

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Summary of Changes

  • Vitest Scaling: Generate test artifacts directly via asynchronous file writes in tests/e2e/tests/vitest/larger-project.ts rather than spawning 500 ng generate CLI child processes.
  • Redundant Runs: Remove redundant initial ng test execution in tests/e2e/tests/test/test-scripts.ts.
  • Flakiness & Race Conditions: Fix regex output matching in tests/e2e/tests/vite/reuse-dep-optimization-cache.ts to directly await /dependencies optimized/.
  • Browser Sandboxing: Add --disable-dev-shm-usage and --disable-gpu flags to Chromium launch arguments in tests/e2e/utils/puppeteer.ts for container/sandbox stability.

Benchmark Results

Test / Component Baseline Optimized Difference
tests/vitest/larger-project 155.60s 42.34s -113.26s (-72.8%)
tests/test/test-scripts 12.62s 8.84s -3.78s (-29.9%)
tests/vite/reuse-dep-optimization-cache Timeout / Fail 12.53s Eliminates ~5m CI retry

@alan-agius4
alan-agius4 requested a review from clydin August 7, 2026 18:08
@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer and removed target: minor This PR is targeted for the next minor release labels Aug 7, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors several end-to-end tests to improve performance and stability. Notably, it removes a deprecated test, simplifies Vite dependency optimization cache testing, adds stability flags to Puppeteer, and refactors artifact generation in Vitest tests to write files directly to disk instead of spawning multiple CLI commands. Regarding the feedback, a potential issue was identified in the Vitest test refactoring where writing a large number of files concurrently using Promise.all could exceed the operating system's file descriptor limit, and a suggestion was provided to limit the concurrency.

Comment thread tests/e2e/tests/vitest/larger-project.ts Outdated
- Generate test artifacts directly via asynchronous file writes in `tests/vitest/larger-project.ts` instead of executing 500 `ng generate` CLI child processes.
- Remove redundant initial `ng test` execution in `tests/test/test-scripts.ts`.
- Fix regex matching in `tests/vite/reuse-dep-optimization-cache.ts` to directly await `/dependencies optimized/`, eliminating race conditions and timeouts.
- Add `--disable-dev-shm-usage` and `--disable-gpu` flags to Chromium launch arguments in `tests/utils/puppeteer.ts` for container and sandbox stability.

Benchmark results:
- `tests/vitest/larger-project`: 155.60s -> 42.34s (-113.26s / -72.8%)
- `tests/test/test-scripts`: 12.62s -> 8.84s (-3.78s / -29.9%)
- `tests/vite/reuse-dep-optimization-cache`: timeout/failure -> 12.53s (passed)
@alan-agius4
alan-agius4 force-pushed the test/e2e-performance-and-stability branch from c021078 to b2d69db Compare August 7, 2026 18:11
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 7, 2026
@alan-agius4
alan-agius4 merged commit d0898e1 into angular:main Aug 7, 2026
40 checks passed
@alan-agius4
alan-agius4 deleted the test/e2e-performance-and-stability branch August 7, 2026 18:34
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

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

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants