@@ -508,8 +508,8 @@ describe('Auth', function () {
508508 await fs . delete ( tmpDir , { recursive : true } )
509509 } )
510510
511- for ( const _ of Array . from ( { length : 100 } , ( i ) => i ) ) {
512- it ( 'does not cache if the credentials file changes' , async function ( ) {
511+ for ( const _ of Array . from ( { length : 1 } , ( i ) => i ) ) {
512+ it . only ( 'does not cache if the credentials file changes' , async function ( ) {
513513 const initialCreds = {
514514 profileName : 'default' ,
515515 accessKey : 'x' ,
@@ -525,20 +525,22 @@ describe('Auth', function () {
525525 secretAccessKey : initialCreds . secretKey ,
526526 sessionToken : undefined ,
527527 } )
528- const lastModifiedBefore = ( await fs . stat ( getCredentialsFilename ( ) ) ) . mtime
528+ const statBefore = await fs . stat ( getCredentialsFilename ( ) )
529529
530530 await fs . delete ( getCredentialsFilename ( ) )
531+ console . log ( 'file deleted' )
531532
532533 const newCreds = { ...initialCreds , accessKey : 'y' , secretKey : 'y' }
533534 await UserCredentialsUtils . generateCredentialsFile ( newCreds )
534- const lastModifiedAfter = ( await fs . stat ( getCredentialsFilename ( ) ) ) . mtime
535+ console . log ( 'file written' )
536+ const statAfter = await fs . stat ( getCredentialsFilename ( ) )
535537 const credsAreUpdated = ( creds : Credentials ) => {
536538 return creds . accessKeyId === newCreds . accessKey && creds . secretAccessKey === newCreds . secretKey
537539 }
538- console . log ( 'before: %O, after: %O' , lastModifiedBefore , lastModifiedAfter )
539- assert . notStrictEqual ( lastModifiedBefore , lastModifiedAfter , 'Expected credentials file to be updated' )
540+ console . log ( 'before: %O, after: %O' , statBefore , statAfter )
541+ assert . notStrictEqual ( statBefore , statAfter , 'Expected credentials file to be updated' )
540542 const credsUpdated = await waitUntil ( async ( ) => credsAreUpdated ( await conn . getCredentials ( ) ) , {
541- timeout : 5000 ,
543+ timeout : 1000 ,
542544 interval : 100 ,
543545 truthy : true ,
544546 } )
0 commit comments