Skip to content

Commit 6d5ec44

Browse files
authored
Merge pull request #6765 from zuoyaofu/change-timeout
fix(amazonq): increase scan timeout threshold
2 parents 40db8b8 + a19b025 commit 6d5ec44

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "increase scan timeout to reduce front-end timeout errors"
4+
}

packages/amazonq/test/unit/codewhisperer/service/securityScanHandler.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
ListCodeScanFindingsResponse,
1616
pollScanJobStatus,
1717
SecurityScanTimedOutError,
18+
CodeWhispererConstants,
1819
} from 'aws-core-vscode/codewhisperer'
1920
import { timeoutUtils } from 'aws-core-vscode/shared'
2021
import assert from 'assert'
@@ -303,7 +304,7 @@ describe('securityScanHandler', function () {
303304

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

306-
const expectedTimeoutMs = 60_000
307+
const expectedTimeoutMs = CodeWhispererConstants.expressScanTimeoutMs
307308
clock.tick(expectedTimeoutMs + 1000)
308309

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

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

317-
const expectedTimeoutMs = 600_000
318+
const expectedTimeoutMs = CodeWhispererConstants.standardScanTimeoutMs
318319
clock.tick(expectedTimeoutMs + 1000)
319320

320321
await assert.rejects(() => pollPromise, SecurityScanTimedOutError)

packages/core/src/codewhisperer/models/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export const codeScanZipExt = '.zip'
261261

262262
export const contextTruncationTimeoutSeconds = 10
263263

264-
export const standardScanTimeoutMs = 600_000 // 10 minutes
264+
export const standardScanTimeoutMs = 900_000 // 15 minutes
265265

266266
export const expressScanTimeoutMs = 60_000
267267

0 commit comments

Comments
 (0)