Skip to content

Commit a17cd5c

Browse files
committed
(#174) Added timer tolerance to stabilize CI pipeline
1 parent fd85acb commit a17cd5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/util/poll-action.function.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ describe("poll-action", () => {
123123
// GIVEN
124124
const updateInterval = 100;
125125
const maxDuration = 200;
126+
const timerTolerance = 1.05;
126127
const action = jest.fn(() => {
127128
return new Promise((_, reject) => {
128129
setTimeout(() => reject(), 300);
@@ -140,6 +141,6 @@ describe("poll-action", () => {
140141

141142
// THEN
142143
expect(action).toBeCalledTimes(1);
143-
expect((end - start)).toBeGreaterThanOrEqual(maxDuration);
144+
expect((end - start)).toBeLessThanOrEqual(maxDuration*timerTolerance);
144145
});
145146
});

0 commit comments

Comments
 (0)