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()
614614 {
615615 await Assert . ThrowsAsync < InvalidOperationException > ( async ( ) =>
616616 {
617- for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 1 ; i ++ )
617+ for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 10 ; i ++ )
618618 {
619619 File . WriteAllText ( Path . Combine ( directory . Path , functionName + ".json" ) , functionSecretsJson ) ;
620620 functionSecrets = await secretManager . GetFunctionSecretsAsync ( functionName ) ;
621+ if ( i > ScriptConstants . MaximumSecretBackupCount )
622+ {
623+ await Task . Delay ( 500 ) ;
624+ }
621625 }
622626 } ) ;
623627 }
624628
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 ) ;
626630 Assert . True ( traceWriter . Traces . Any (
627631 t => t . Level == TraceLevel . Verbose && t . Message . IndexOf ( expectedTraceMessage , StringComparison . OrdinalIgnoreCase ) > - 1 ) ,
628632 "Expected Trace message not found" ) ;
You can’t perform that action at this time.
0 commit comments