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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "increase scan timeout to reduce front-end timeout errors"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
ListCodeScanFindingsResponse,
pollScanJobStatus,
SecurityScanTimedOutError,
CodeWhispererConstants,
} from 'aws-core-vscode/codewhisperer'
import { timeoutUtils } from 'aws-core-vscode/shared'
import assert from 'assert'
Expand Down Expand Up @@ -303,7 +304,7 @@ describe('securityScanHandler', function () {

const pollPromise = pollScanJobStatus(mockClient, mockJobId, CodeAnalysisScope.FILE_AUTO, mockStartTime)

const expectedTimeoutMs = 60_000
const expectedTimeoutMs = CodeWhispererConstants.expressScanTimeoutMs
clock.tick(expectedTimeoutMs + 1000)

await assert.rejects(() => pollPromise, SecurityScanTimedOutError)
Expand All @@ -314,7 +315,7 @@ describe('securityScanHandler', function () {

const pollPromise = pollScanJobStatus(mockClient, mockJobId, CodeAnalysisScope.PROJECT, mockStartTime)

const expectedTimeoutMs = 600_000
const expectedTimeoutMs = CodeWhispererConstants.standardScanTimeoutMs
clock.tick(expectedTimeoutMs + 1000)

await assert.rejects(() => pollPromise, SecurityScanTimedOutError)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/codewhisperer/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export const codeScanZipExt = '.zip'

export const contextTruncationTimeoutSeconds = 10

export const standardScanTimeoutMs = 600_000 // 10 minutes
export const standardScanTimeoutMs = 900_000 // 15 minutes
Copy link
Contributor

@nkomonen-amazon nkomonen-amazon Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I typically prefer breaking down the calculation for better readability, 60_000 * 15


export const expressScanTimeoutMs = 60_000

Expand Down
Loading