Skip to content

Commit

Permalink
[Tests] fix JUnit Reporter test (opensearch-project#1338)
Browse files Browse the repository at this point in the history
Interesting flakiness in the test. After the jest upgrade, our tests
got more performant.

The JUnit Report integ test was actually expecting `anything` for a field
`time`. This `time` was calculated on elapsed time to the `0.00x` value
anything faster would actually be undefined and at that point `anything`
fails because `anything` cannot be undefined.

tl;dr: This test became flakey because our tests now run too fast.

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla authored Mar 10, 2022
1 parent 852e2ac commit f7f9c22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dev/jest/integration_tests/__fixtures__/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
* GitHub history for details.
*/

it('fails', () => {
it('fails', (done) => {
setTimeout(() => {
done();
}, 200);
throw new Error('failure');
});

0 comments on commit f7f9c22

Please sign in to comment.