File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
test/WebJobs.Script.Tests Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ await Task.WhenAll(
4949 }
5050
5151 [ Fact ]
52- public void SetNewLogFile_PurgesOldLogFiles ( )
52+ public async Task SetNewLogFile_PurgesOldLogFiles ( )
5353 {
5454 DirectoryInfo directory = new DirectoryInfo ( _logFilePath ) ;
5555 directory . Create ( ) ;
@@ -83,9 +83,14 @@ public void SetNewLogFile_PurgesOldLogFiles()
8383
8484 files = directory . GetFiles ( ) . OrderByDescending ( p => p . LastWriteTime ) . ToArray ( ) ;
8585
86+ await TestHelpers . Await ( ( ) =>
87+ {
88+ files = directory . GetFiles ( ) . OrderByDescending ( p => p . LastWriteTime ) . ToArray ( ) ;
89+ return files . Length == 2 ;
90+ } , timeout : 2000 ) ;
91+
8692 // verify the correct log files were purged and the 2
8793 // most recent files were retained
88- Assert . Equal ( 2 , files . Length ) ;
8994 Assert . True ( files [ 0 ] . Name . StartsWith ( "4" ) ) ;
9095 Assert . True ( files [ 1 ] . Name . StartsWith ( "3" ) ) ;
9196 }
You can’t perform that action at this time.
0 commit comments