From c2b736612cbc5ebd61fcfaebce5b9a45522743e9 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 6 Dec 2024 14:10:19 +0100 Subject: [PATCH] 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. --- packages/e2e-tests/test/e2e.spec.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/e2e-tests/test/e2e.spec.ts b/packages/e2e-tests/test/e2e.spec.ts index 43971d67c..acf2388ec 100644 --- a/packages/e2e-tests/test/e2e.spec.ts +++ b/packages/e2e-tests/test/e2e.spec.ts @@ -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); + }); }); });