Skip to content

fix(cdk/testing): propagate task state to child environments - #33924

Closed
crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:safari-task-state
Closed

crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:safari-task-state

Conversation

@crisbeto

@crisbeto crisbeto commented Oct 2, 2026

Copy link
Copy Markdown
Member

When creating a harness via harnessForFixture, we await environment.forceStabilize() before creating the component harness and its child environment. In newer versions of Safari, resuming from native await can escape the test zone back to the root zone. This caused child environments created afterwards to fail the isInProxyZone() check and omit _taskState, preventing waitForTasksOutsideAngular from tracking async tasks scheduled outside Angular.

These changes resolve the issue by propagating the task state from the parent TestbedHarnessEnvironment down to child environments created via createEnvironment.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Oct 2, 2026
Attemps to fix the Safari failure that showed up on CI.
@crisbeto crisbeto closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cdk/testing target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant