@@ -1821,8 +1821,11 @@ describe('e2e', function () {
1821
1821
1822
1822
// Add the newly created log file
1823
1823
paths . push ( path . join ( customLogDir . path , getLogName ( shell . logId ) ) ) ;
1824
- // Expect 6 files to be deleted and 5 to remain (including the new log file)
1825
- expect ( await getFilesState ( paths ) ) . equals ( '00000011111' ) ;
1824
+
1825
+ await eventually ( async ( ) => {
1826
+ // Expect 6 files to be deleted and 5 to remain (including the new log file)
1827
+ expect ( await getFilesState ( paths ) ) . equals ( '00000011111' ) ;
1828
+ } ) ;
1826
1829
} ) ;
1827
1830
} ) ;
1828
1831
@@ -1874,10 +1877,13 @@ describe('e2e', function () {
1874
1877
await shell . waitForPrompt ( ) ;
1875
1878
1876
1879
paths . push ( path . join ( customLogDir . path , getLogName ( shell . logId ) ) ) ;
1877
- // 3 log files without mongosh_ prefix should remain
1878
- // 2 log file with mongosh_ prefix should be deleted
1879
- // 2 log files with mongosh_ prefix should remain (including the new log)
1880
- expect ( await getFilesState ( paths ) ) . to . equal ( '1110011' ) ;
1880
+
1881
+ await eventually ( async ( ) => {
1882
+ // 3 log files without mongosh_ prefix should remain
1883
+ // 2 log file with mongosh_ prefix should be deleted
1884
+ // 2 log files with mongosh_ prefix should remain (including the new log)
1885
+ expect ( await getFilesState ( paths ) ) . to . equal ( '1110011' ) ;
1886
+ } ) ;
1881
1887
} ) ;
1882
1888
1883
1889
it ( 'should delete files once it is above logMaxFileCount' , async function ( ) {
@@ -1913,8 +1919,10 @@ describe('e2e', function () {
1913
1919
await shell . executeLine ( 'config.get("logMaxFileCount")' )
1914
1920
) . contains ( '4' ) ;
1915
1921
1916
- // Expect 7 files to be deleted and 4 to remain (including the new log file)
1917
- expect ( await getFilesState ( paths ) ) . to . equal ( '00000001111' ) ;
1922
+ await eventually ( async ( ) => {
1923
+ // Expect 7 files to be deleted and 4 to remain (including the new log file)
1924
+ expect ( await getFilesState ( paths ) ) . to . equal ( '00000001111' ) ;
1925
+ } ) ;
1918
1926
} ) ;
1919
1927
} ) ;
1920
1928
@@ -1959,9 +1967,11 @@ describe('e2e', function () {
1959
1967
await shell . executeLine ( 'config.get("logRetentionGB")' )
1960
1968
) . contains ( `${ 4 / 1024 } ` ) ;
1961
1969
1962
- // Expect 6 files to be deleted and 4 to remain
1963
- // (including the new log file which should be <1 MB)
1964
- expect ( await getFilesState ( paths ) ) . to . equal ( '00000001111' ) ;
1970
+ await eventually ( async ( ) => {
1971
+ // Expect 6 files to be deleted and 4 to remain
1972
+ // (including the new log file which should be <1 MB)
1973
+ expect ( await getFilesState ( paths ) ) . to . equal ( '00000001111' ) ;
1974
+ } ) ;
1965
1975
} ) ;
1966
1976
} ) ;
1967
1977
0 commit comments