Skip to content

Commit 86cbc6d

Browse files
committed
fix(tests): unset the environment variable for log file count
1 parent 7d3a666 commit 86cbc6d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,7 @@ describe('e2e', function () {
18521852
args: ['--nodb'],
18531853
env: {
18541854
...env,
1855+
MONGOSH_TEST_ONLY_MAX_LOG_FILE_COUNT: '',
18551856
MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING: globalConfig,
18561857
},
18571858
forceTerminal: true,
@@ -1917,17 +1918,15 @@ describe('e2e', function () {
19171918
)}\n logRetentionGB: ${4 / 1024}`
19181919
);
19191920
const paths: string[] = [];
1920-
const offset = Math.floor(Date.now() / 1000);
19211921

19221922
// Create 10 log files, around 1 mb each
1923-
for (let i = 9; i >= 0; i--) {
1924-
const filename = path.join(
1925-
customLogDir.path,
1926-
ObjectId.createFromTime(offset - i).toHexString() + '_log'
1927-
);
1928-
await fs.writeFile(filename, '0'.repeat(1024 * 1024));
1929-
paths.push(filename);
1930-
}
1923+
paths.push(
1924+
...(await createFakeLogFiles({
1925+
count: 10,
1926+
size: 1024 * 1024,
1927+
basePath: customLogDir.path,
1928+
}))
1929+
);
19311930

19321931
// All 10 existing log files exist.
19331932
expect(await getFilesState(paths)).to.equal('1111111111');

0 commit comments

Comments
 (0)