File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
test/WebJobs.Script.Tests/Security Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -614,15 +614,19 @@ public async Task GetHostSecrets_WhenTooManyBackups_ThrowsException()
614
614
{
615
615
await Assert . ThrowsAsync < InvalidOperationException > ( async ( ) =>
616
616
{
617
- for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 1 ; i ++ )
617
+ for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 10 ; i ++ )
618
618
{
619
619
File . WriteAllText ( Path . Combine ( directory . Path , functionName + ".json" ) , functionSecretsJson ) ;
620
620
functionSecrets = await secretManager . GetFunctionSecretsAsync ( functionName ) ;
621
+ if ( i > ScriptConstants . MaximumSecretBackupCount )
622
+ {
623
+ await Task . Delay ( 500 ) ;
624
+ }
621
625
}
622
626
} ) ;
623
627
}
624
628
625
- Assert . Equal ( ScriptConstants . MaximumSecretBackupCount , Directory . GetFiles ( directory . Path , $ "{ functionName } .{ ScriptConstants . Snapshot } *") . Length ) ;
629
+ Assert . True ( Directory . GetFiles ( directory . Path , $ "{ functionName } .{ ScriptConstants . Snapshot } *") . Length >= ScriptConstants . MaximumSecretBackupCount ) ;
626
630
Assert . True ( traceWriter . Traces . Any (
627
631
t => t . Level == TraceLevel . Verbose && t . Message . IndexOf ( expectedTraceMessage , StringComparison . OrdinalIgnoreCase ) > - 1 ) ,
628
632
"Expected Trace message not found" ) ;
You can’t perform that action at this time.
0 commit comments