Skip to content

Commit 09e723c

Browse files
committed
test(zone.js): reduce flakiness of a timer-related test
This commit updates a flaky test to increase the amount of work (more `for` loop iterations) to minimize the chance of getting the same timestamp after that work.
1 parent fe8a683 commit 09e723c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/zone.js/test/jest/jest.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe('jest modern fakeTimers with zone.js fakeAsync', () => {
141141
let d = fakeAsyncZoneSpec.getRealSystemTime();
142142
jest.setSystemTime(d);
143143
expect(Date.now()).toEqual(d);
144-
for (let i = 0; i < 100000; i++) {}
144+
for (let i = 0; i < 10_000_000; i++) {}
145145
expect(fakeAsyncZoneSpec.getRealSystemTime()).not.toEqual(d);
146146
d = fakeAsyncZoneSpec.getRealSystemTime();
147147
let timeoutTriggered = false;

0 commit comments

Comments
 (0)