Skip to content

Commit ce87909

Browse files
committed
try sleeping in between regen
1 parent d7499fd commit ce87909

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import { getCredentialsFilename } from '../../auth/credentials/sharedCredentials
2020
import { Connection, isIamConnection, isSsoConnection, scopesSsoAccountAccess } from '../../auth/connection'
2121
import { AuthNode, createDeleteConnectionButton, promptForConnection } from '../../auth/utils'
2222
import { Credentials } from '@aws-sdk/types'
23-
import { waitUntil } from '../../shared'
23+
import { sleep, waitUntil } from '../../shared'
24+
import { isWin } from '../../shared/vscode/env'
2425

2526
const ssoProfile = createSsoProfile()
2627
const scopedSsoProfile = createSsoProfile({ scopes: ['foo'] })
@@ -533,10 +534,20 @@ describe('Auth', function () {
533534
console.log('Deleting the credentials file')
534535
await fs.delete(getCredentialsFilename())
535536

537+
console.log('sleeping first time for a second')
538+
if (isWin()) {
539+
await sleep(1000)
540+
}
541+
536542
const newCreds = { ...initialCreds, accessKey: 'y', secretKey: 'y' }
537543
console.log('Regenerating credentials file')
538544
await UserCredentialsUtils.generateCredentialsFile(newCreds)
539545

546+
console.log('sleeping second time for a second')
547+
if (isWin()) {
548+
await sleep(1000)
549+
}
550+
540551
const statsAfterRegen = await fs.stat(getCredentialsFilename())
541552
const contentAfterRegen = await fs.readFileText(getCredentialsFilename())
542553
const credsAreUpdated = (creds: Credentials) => {

0 commit comments

Comments
 (0)