From 2fd1963caaae794ed5614552fc16a0dfb9d60483 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 4 Dec 2024 12:33:48 +0100 Subject: [PATCH] chore(e2e-tests): account for race condition in driver version log file test MONGOSH-1934 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); + }); }); });