Skip to content

Commit 5e95fa6

Browse files
committed
fixup
1 parent 3fac216 commit 5e95fa6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/amazonq/test/e2e/inline/inline.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
closeAllEditors,
1111
getTestWindow,
1212
registerAuthHook,
13+
resetCodeWhispererGlobalVariables,
1314
TestFolder,
1415
toTextEditor,
1516
using,
@@ -37,6 +38,7 @@ describe('Amazon Q Inline', async function () {
3738
const folder = await TestFolder.create()
3839
tempFolder = folder.path
3940
await closeAllEditors()
41+
await resetCodeWhispererGlobalVariables(false)
4042
})
4143

4244
afterEach(async function () {
@@ -95,7 +97,7 @@ describe('Amazon Q Inline', async function () {
9597
*
9698
* note: this number is entirely arbitrary
9799
**/
98-
await sleep(2000)
100+
await sleep(1000)
99101

100102
await invokeCompletion()
101103
originalEditorContents = vscode.window.activeTextEditor?.document.getText()

packages/core/src/test/codewhisperer/testUtil.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ import * as model from '../../codewhisperer/models/model'
2828
import { stub } from '../utilities/stubber'
2929
import { Dirent } from 'fs' // eslint-disable-line no-restricted-imports
3030

31-
export async function resetCodeWhispererGlobalVariables() {
31+
export async function resetCodeWhispererGlobalVariables(clearGlobalState: boolean = true) {
3232
vsCodeState.isIntelliSenseActive = false
3333
vsCodeState.isCodeWhispererEditing = false
3434
CodeWhispererCodeCoverageTracker.instances.clear()
3535
globals.telemetry.logger.clear()
3636
session.reset()
37-
await globals.globalState.clear()
37+
if (clearGlobalState) {
38+
await globals.globalState.clear()
39+
}
3840
await CodeSuggestionsState.instance.setSuggestionsEnabled(true)
3941
await RecommendationHandler.instance.clearInlineCompletionStates()
4042
}

0 commit comments

Comments
 (0)