Skip to content

Commit

Permalink
fix: adjust flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
smoya committed Oct 20, 2023
1 parent 4efb44d commit 3d09bea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/recorder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ describe('Recorder', function() {
expect(recorderMetricsSpy).toHaveLength(1);
expect(recorderMetricsSpy[0]).toEqual(expectedMetric);

await new Promise(f => setTimeout(f, 500));
await new Promise(f => setTimeout(f, 700));
stop();

expect(sink.calledTimes).toBeGreaterThan(3); // Aprox 5 calls
expect(sink.calledTimes).toBeLessThan(7); // Aprox 5 calls
expect(sink.calledTimes).toBeGreaterThan(3); // Theory: 7 calls. Real: aprox 5 or 6 calls
expect(sink.calledTimes).toBeLessThan(8);
});
});

0 comments on commit 3d09bea

Please sign in to comment.