Skip to content

test(@angular/build): avoid race conditions in incremental-watch e2e test - #33815

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:test/e2e-incremental-watch-race-condition
Aug 7, 2026
Merged

test(@angular/build): avoid race conditions in incremental-watch e2e test#33815
clydin merged 1 commit into
angular:mainfrom
clydin:test/e2e-incremental-watch-race-condition

Conversation

@clydin

@clydin clydin commented Aug 7, 2026

Copy link
Copy Markdown
Member

Remove an extraneous await inside the Promise.all array literal in incremental-watch.ts that caused writeFile('src/a.ts') to execute sequentially before appendToFile('src/main.ts'), triggering an unintended intermediate rebuild.

Additionally, replace static setTimeout(500) delays with a deterministic polling helper getOutputFiles to prevent ENOENT errors when reading the output directory before file emission completes.

…test

Remove an extraneous `await` inside the `Promise.all` array literal in `incremental-watch.ts` that caused `writeFile('src/a.ts')` to execute sequentially before `appendToFile('src/main.ts')`, triggering an unintended intermediate rebuild.

Additionally, replace static `setTimeout(500)` delays with a deterministic polling helper `getOutputFiles` to prevent ENOENT errors when reading the output directory before file emission completes.
@clydin clydin added the target: patch This PR is targeted for the next patch release label 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 introduces a helper function getOutputFiles in tests/e2e/tests/build/incremental-watch.ts to replace arbitrary timeouts with a polling mechanism that waits for output files to match a predicate. It also removes an unnecessary await inside a Promise.all call. The feedback suggests handling potential ENOENT errors when reading the directory after a timeout to ensure the assertion fails with a descriptive message instead of throwing an unhandled exception.

Comment thread tests/e2e/tests/build/incremental-watch.ts
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 7, 2026
@clydin
clydin requested a review from alan-agius4 August 7, 2026 20:26
@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
@clydin
clydin merged commit 45565dd into angular:main Aug 7, 2026
43 checks passed
@clydin

clydin commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

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

@clydin
clydin deleted the test/e2e-incremental-watch-race-condition branch August 7, 2026 21:23
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