Skip to content

test(@angular/build): prevent flakiness in incremental-watch e2e test - #34070

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:test/incremental-watch-chunk-count
Sep 10, 2026
Merged

test(@angular/build): prevent flakiness in incremental-watch e2e test#34070
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:test/incremental-watch-chunk-count

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

In watch mode, Application bundle generation complete. can be logged before all files have finished being emitted to disk. Sampling files.length > 0 initially could capture a partial file count, causing the final count comparison to time out once all assets (like sourcemaps, icons, etc.) are fully written.

This change updates the test to only track JavaScript chunk files (.js), preventing race conditions with unrelated asset emission and directly aligning with the test's intent of verifying chunk addition and removal for dynamic imports.

@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 introduces a helper function getOutputChunks in the incremental-watch E2E test to filter and work specifically with JS chunk files, updating the test assertions accordingly. The reviewer suggested extracting the duplicated .endsWith('.js') check into a local helper function isChunk to improve maintainability and avoid duplication.

Comment thread tests/e2e/tests/build/incremental-watch.ts Outdated
In watch mode, 'Application bundle generation complete.' can be logged before all files have finished being emitted to disk. Sampling 'files.length > 0' initially could capture a partial file count, causing the final count comparison to time out once all assets are fully written.

Update the test to only track JavaScript chunk files (.js), which prevents race conditions with unrelated asset emission and directly aligns with the test's intent of verifying chunk addition and removal for dynamic imports.
@alan-agius4
alan-agius4 force-pushed the test/incremental-watch-chunk-count branch from a3fe2cf to 2520ed3 Compare September 10, 2026 13:56
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Sep 10, 2026
@alan-agius4
alan-agius4 requested a review from clydin September 10, 2026 13:56
@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 Sep 10, 2026
@alan-agius4
alan-agius4 merged commit d213df7 into angular:main Sep 10, 2026
41 of 42 checks passed
@alan-agius4
alan-agius4 deleted the test/incremental-watch-chunk-count branch September 10, 2026 14:15
@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 area: @angular/build 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