File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments