File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
test/WebJobs.Script.Tests/Security Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -615,14 +615,17 @@ public async Task GetHostSecrets_WhenTooManyBackups_ThrowsException()
615615 InvalidOperationException ioe = null ;
616616 try
617617 {
618- for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 10 ; i ++ )
618+ for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 20 ; i ++ )
619619 {
620620 File . WriteAllText ( Path . Combine ( directory . Path , functionName + ".json" ) , functionSecretsJson ) ;
621- functionSecrets = await secretManager . GetFunctionSecretsAsync ( functionName ) ;
622- if ( i > ScriptConstants . MaximumSecretBackupCount )
621+
622+ // If we haven't hit the exception yet, pause to ensure the file contents are being flushed.
623+ if ( i >= ScriptConstants . MaximumSecretBackupCount )
623624 {
624625 await Task . Delay ( 500 ) ;
625626 }
627+
628+ functionSecrets = await secretManager . GetFunctionSecretsAsync ( functionName ) ;
626629 }
627630 }
628631 catch ( InvalidOperationException ex )
You can’t perform that action at this time.
0 commit comments