From c2436702df980bbf2db0fe3bee4c72860edb4e63 Mon Sep 17 00:00:00 2001 From: Jessica Janiuk Date: Wed, 22 Jan 2025 15:50:16 -0500 Subject: [PATCH] fix(core): fixes test timer-based test flakiness in CI (#59674) This converts two tests that rely on timers to use fakeAsync. This resolves the flakiness. PR Close #59674 --- .../platform-server/test/incremental_hydration_spec.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/platform-server/test/incremental_hydration_spec.ts b/packages/platform-server/test/incremental_hydration_spec.ts index 4be2b69ef28..aee30608e21 100644 --- a/packages/platform-server/test/incremental_hydration_spec.ts +++ b/packages/platform-server/test/incremental_hydration_spec.ts @@ -38,7 +38,7 @@ import { withEventReplay, withIncrementalHydration, } from '@angular/platform-browser'; -import {TestBed} from '@angular/core/testing'; +import {fakeAsync, TestBed} from '@angular/core/testing'; import {PLATFORM_BROWSER_ID} from '@angular/common/src/platform_id'; import {DEHYDRATED_BLOCK_REGISTRY} from '@angular/core/src/defer/registry'; import {JSACTION_BLOCK_ELEMENT_MAP} from '@angular/core/src/hydration/tokens'; @@ -1329,7 +1329,7 @@ describe('platform-server partial hydration integration', () => { }); describe('timer', () => { - it('top level timer', async () => { + it('top level timer', fakeAsync(async () => { @Component({ selector: 'app', template: ` @@ -1399,9 +1399,9 @@ describe('platform-server partial hydration integration', () => { appRef.tick(); expect(appHostNode.outerHTML).toContain('end'); - }); + })); - it('nested timer', async () => { + it('nested timer', fakeAsync(async () => { @Component({ selector: 'app', template: ` @@ -1487,7 +1487,7 @@ describe('platform-server partial hydration integration', () => { appRef.tick(); expect(appHostNode.outerHTML).toContain('end'); - }); + })); }); it('when', async () => {