Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildspec/shared/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# - "waiting for browser": from `ssoAccessTokenProvider.test.ts`, unclear how to fix it.
# - "HTTPError: Response code …": caused by github rate-limiting.
# - "npm WARN deprecated querystring": transitive dep of aws sdk v2 (check `npm ls querystring`), so that's blocked until we migrate to v3.
_ignore_pat='Timed-out waiting for browser login flow\|HTTPError: Response code 403\|HTTPError: Response code 404\|npm WARN deprecated querystring\|npm WARN deprecated'
_ignore_pat='HTTPError: Response code 403\|HTTPError: Response code 404\|npm WARN deprecated querystring\|npm WARN deprecated'

# Do not print (noisy) lines matching these patterns.
# - "ERROR:bus… Failed to connect to the bus": noise related to "xvfb". https://github.com/cypress-io/cypress/issues/19299
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,27 +310,29 @@ describe('SsoAccessTokenProvider', function () {
})

it('respects the device authorization expiration time', async function () {
// XXX: Don't know how to fix this "unhandled rejection" caused by this test:
// rejected promise not handled within 1 second: Error: Timed-out waiting for browser login flow to complete
// at poll (…/src/auth/sso/ssoAccessTokenProvider.ts:251:15)
// at async SsoAccessTokenProvider.authorize (…/src/auth/sso/ssoAccessTokenProvider.ts:188:23)
// at async SsoAccessTokenProvider.runFlow (…/src/auth/sso/ssoAccessTokenProvider.ts:113:20)
// at async SsoAccessTokenProvider.createToken (…/src/auth/sso/ssoAccessTokenProvider.ts:102:24)

setupFlow()
stubOpen()
const exception = new AuthorizationPendingException({ message: '', $metadata: {} })
const authorization = createAuthorization(1000)
oidcClient.createToken.rejects(exception)
oidcClient.startDeviceAuthorization.resolves(authorization)

const resp = sut.createToken()
const resp = sut
.createToken()
.then(() => assert.fail('Should not resolve'))
.catch((e) => {
assert.ok(
e instanceof ToolkitError &&
e.message === 'Timed-out waiting for browser login flow to complete'
)
})

const progress = await getTestWindow().waitForMessage(/login page opened/i)
await clock.tickAsync(750)
assert.ok(progress.visible)
await clock.tickAsync(750)
assert.ok(!progress.visible)
await assert.rejects(resp, ToolkitError)
await resp
assertTelemetry('aws_loginWithBrowser', {
result: 'Failed',
isReAuth: undefined,
Expand Down
Loading