Skip to content

Commit a9f9ef7

Browse files
✅ fix flaky test (#3837)
The task queue was not properly stopped when a test finished Jasmine seed: 95071
1 parent 184c1c3 commit a9f9ef7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/core/src/tools/taskQueue.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const MAX_EXECUTION_TIME_ON_TIMEOUT = 30
2020

2121
export interface TaskQueue {
2222
push(task: Task): void
23+
stop(): void
2324
}
2425

2526
type Task = () => void
@@ -55,5 +56,8 @@ export function createTaskQueue(): TaskQueue {
5556
scheduleNextRun()
5657
}
5758
},
59+
stop() {
60+
pendingTasks.length = 0
61+
},
5862
}
5963
}

packages/rum-core/src/domain/resource/resourceCollection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export function startResourceCollection(
8585

8686
return {
8787
stop: () => {
88+
taskQueue.stop()
8889
performanceResourceSubscription.unsubscribe()
8990
},
9091
}

0 commit comments

Comments
 (0)