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(
49
49
}
50
50
51
51
[ Fact ]
52
- public void SetNewLogFile_PurgesOldLogFiles ( )
52
+ public async Task SetNewLogFile_PurgesOldLogFiles ( )
53
53
{
54
54
DirectoryInfo directory = new DirectoryInfo ( _logFilePath ) ;
55
55
directory . Create ( ) ;
@@ -83,9 +83,14 @@ public void SetNewLogFile_PurgesOldLogFiles()
83
83
84
84
files = directory . GetFiles ( ) . OrderByDescending ( p => p . LastWriteTime ) . ToArray ( ) ;
85
85
86
+ await TestHelpers . Await ( ( ) =>
87
+ {
88
+ files = directory . GetFiles ( ) . OrderByDescending ( p => p . LastWriteTime ) . ToArray ( ) ;
89
+ return files . Length == 2 ;
90
+ } , timeout : 2000 ) ;
91
+
86
92
// verify the correct log files were purged and the 2
87
93
// most recent files were retained
88
- Assert . Equal ( 2 , files . Length ) ;
89
94
Assert . True ( files [ 0 ] . Name . StartsWith ( "4" ) ) ;
90
95
Assert . True ( files [ 1 ] . Name . StartsWith ( "3" ) ) ;
91
96
}
You can’t perform that action at this time.
0 commit comments