@@ -19,6 +19,7 @@ import { UserCredentialsUtils } from '../../shared/credentials/userCredentialsUt
1919import { getCredentialsFilename } from '../../auth/credentials/sharedCredentialsFile'
2020import { Connection , isIamConnection , isSsoConnection , scopesSsoAccountAccess } from '../../auth/connection'
2121import { AuthNode , createDeleteConnectionButton , promptForConnection } from '../../auth/utils'
22+ import { waitUntil } from '../../shared'
2223
2324const ssoProfile = createSsoProfile ( )
2425const scopedSsoProfile = createSsoProfile ( { scopes : [ 'foo' ] } )
@@ -507,11 +508,6 @@ describe('Auth', function () {
507508 } )
508509 for ( const _ of Array . from ( { length : 1000 } , ( i ) => i ) ) {
509510 it ( 'does not cache if the credentials file changes' , async function ( ) {
510- // if (isWin()) {
511- // this.retries(5)
512- // this.timeout(30000)
513- // }
514-
515511 const initialCreds = {
516512 profileName : 'default' ,
517513 accessKey : 'x' ,
@@ -536,7 +532,9 @@ describe('Auth', function () {
536532 const statAfter = await fs . stat ( getCredentialsFilename ( ) )
537533
538534 assert . ok ( contentBefore !== contentAfter )
539- assert . notDeepStrictEqual ( statAfter , statBefore )
535+
536+ await waitUntil ( async ( ) => statBefore !== ( await fs . stat ( getCredentialsFilename ( ) ) ) , { timeout : 5000 } )
537+ assert . notDeepStrictEqual ( statBefore , statAfter , 'Credentials file update failed' )
540538
541539 assert . deepStrictEqual ( await conn . getCredentials ( ) , {
542540 accessKeyId : newCreds . accessKey ,
0 commit comments