Skip to content

Commit 1161e54

Browse files
committed
add waitUntil for stat changes
1 parent 46ac152 commit 1161e54

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/core/src/test/credentials/auth.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { UserCredentialsUtils } from '../../shared/credentials/userCredentialsUt
1919
import { getCredentialsFilename } from '../../auth/credentials/sharedCredentialsFile'
2020
import { Connection, isIamConnection, isSsoConnection, scopesSsoAccountAccess } from '../../auth/connection'
2121
import { AuthNode, createDeleteConnectionButton, promptForConnection } from '../../auth/utils'
22+
import { waitUntil } from '../../shared'
2223

2324
const ssoProfile = createSsoProfile()
2425
const 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

Comments
 (0)