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 @@ -572,14 +572,17 @@ public async Task GetHostSecrets_WhenTooManyBackups_ThrowsException()
572572 {
573573 await Assert . ThrowsAsync < InvalidOperationException > ( async ( ) =>
574574 {
575- for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 10 ; i ++ )
575+ for ( int i = 0 ; i < ScriptConstants . MaximumSecretBackupCount + 20 ; i ++ )
576576 {
577577 File . WriteAllText ( Path . Combine ( directory . Path , functionName + ".json" ) , functionSecretsJson ) ;
578- functionSecrets = await secretManager . GetFunctionSecretsAsync ( functionName ) ;
579- if ( i > ScriptConstants . MaximumSecretBackupCount )
578+
579+ // If we haven't hit the exception yet, pause to ensure the file contents are being flushed.
580+ if ( i >= ScriptConstants . MaximumSecretBackupCount )
580581 {
581582 await Task . Delay ( 500 ) ;
582583 }
584+
585+ functionSecrets = await secretManager . GetFunctionSecretsAsync ( functionName ) ;
583586 }
584587 } ) ;
585588 }
You can’t perform that action at this time.
0 commit comments