Skip to content

Commit

Permalink
chore(e2e-tests): account for race condition in driver version log fi…
Browse files Browse the repository at this point in the history
…le test MONGOSH-1934 (#2287)

This test has been particularly flaky on macOS, so let's do the same thing
that the preceding test does and account for the fact that the log file
might not be flushed immediately before the output of the command is printed.
  • Loading branch information
addaleax authored Dec 6, 2024
1 parent e422e02 commit c2b7366
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/e2e-tests/test/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1494,12 +1494,14 @@ describe('e2e', function () {
`connect(${JSON.stringify(connectionString)})`
)
).to.include('test');
const log = await readLogfile();
expect(
log.filter(
(logEntry) => typeof logEntry.attr?.driver?.version === 'string'
)
).to.have.lengthOf(1);
await eventually(async () => {
const log = await readLogfile();
expect(
log.filter(
(logEntry) => typeof logEntry.attr?.driver?.version === 'string'
)
).to.have.lengthOf(1);
});
});
});

Expand Down

0 comments on commit c2b7366

Please sign in to comment.