Skip to content

Commit c2b7366

Browse files
authored
chore(e2e-tests): account for race condition in driver version log file 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.
1 parent e422e02 commit c2b7366

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/e2e-tests/test/e2e.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,12 +1494,14 @@ describe('e2e', function () {
14941494
`connect(${JSON.stringify(connectionString)})`
14951495
)
14961496
).to.include('test');
1497-
const log = await readLogfile();
1498-
expect(
1499-
log.filter(
1500-
(logEntry) => typeof logEntry.attr?.driver?.version === 'string'
1501-
)
1502-
).to.have.lengthOf(1);
1497+
await eventually(async () => {
1498+
const log = await readLogfile();
1499+
expect(
1500+
log.filter(
1501+
(logEntry) => typeof logEntry.attr?.driver?.version === 'string'
1502+
)
1503+
).to.have.lengthOf(1);
1504+
});
15031505
});
15041506
});
15051507

0 commit comments

Comments
 (0)