Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Sep 15, 2025

Previously, exceptions thrown within a test runner would cause the entire builder process to terminate. This resulted in a poor user experience, especially in watch mode, as the process would crash instead of reporting the error and waiting for changes.

This change introduces more granular try-catch blocks around the test runner's lifecycle. When a runner throws an exception, the error is now caught, logged with a descriptive message, and the builder emits a failed result without crashing.

To prevent logs from being spammed by a persistently failing runner, a circuit breaker has been added. If the test runner fails with an exception for 3 consecutive runs, the builder will pause testing and exit to prevent an endless error loop. This circuit breaker is specifically designed to only trip on runner exceptions, not on standard test failures, to avoid disrupting a normal TDD workflow.

Additionally, this commit re-enables and adjusts several related unit tests for the builder options to ensure they are passing and reflect the current behavior.

Previously, exceptions thrown within a test runner would cause the entire builder process to terminate. This resulted in a poor user experience, especially in watch mode, as the process would crash instead of reporting the error and waiting for changes.

This change introduces more granular `try-catch` blocks around the test runner's lifecycle. When a runner throws an exception, the error is now caught, logged with a descriptive message, and the builder emits a failed result without crashing.

To prevent logs from being spammed by a persistently failing runner, a circuit breaker has been added. If the test runner fails with an exception for 3 consecutive runs, the builder will pause testing and exit to prevent an endless error loop. This circuit breaker is specifically designed to only trip on runner exceptions, not on standard test failures, to avoid disrupting a normal TDD workflow.

Additionally, this commit re-enables and adjusts several related unit tests for the builder options to ensure they are passing and reflect the current behavior.
@clydin clydin added the target: major This PR is targeted for the next major release label Sep 15, 2025
@clydin clydin marked this pull request as ready for review September 15, 2025 18:24
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 15, 2025
@clydin clydin 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 15, 2025
@clydin clydin merged commit 69c3b12 into angular:main Sep 15, 2025
36 checks passed
@clydin clydin deleted the unit-test/improve-error-handling branch September 15, 2025 19:06
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants