Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinkney-aws committed Feb 4, 2025
1 parent 9a76366 commit 8d16b78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/amazonq/test/e2e/inline/inline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
closeAllEditors,
getTestWindow,
registerAuthHook,
resetCodeWhispererGlobalVariables,
TestFolder,
toTextEditor,
using,
Expand Down Expand Up @@ -37,6 +38,7 @@ describe('Amazon Q Inline', async function () {
const folder = await TestFolder.create()
tempFolder = folder.path
await closeAllEditors()
await resetCodeWhispererGlobalVariables(false)
})

afterEach(async function () {
Expand Down Expand Up @@ -95,7 +97,7 @@ describe('Amazon Q Inline', async function () {
*
* note: this number is entirely arbitrary
**/
await sleep(2000)
await sleep(1000)

await invokeCompletion()
originalEditorContents = vscode.window.activeTextEditor?.document.getText()
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/test/codewhisperer/testUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ import * as model from '../../codewhisperer/models/model'
import { stub } from '../utilities/stubber'
import { Dirent } from 'fs' // eslint-disable-line no-restricted-imports

export async function resetCodeWhispererGlobalVariables() {
export async function resetCodeWhispererGlobalVariables(clearGlobalState: boolean = true) {
vsCodeState.isIntelliSenseActive = false
vsCodeState.isCodeWhispererEditing = false
CodeWhispererCodeCoverageTracker.instances.clear()
globals.telemetry.logger.clear()
session.reset()
await globals.globalState.clear()
if (clearGlobalState) {
await globals.globalState.clear()
}
await CodeSuggestionsState.instance.setSuggestionsEnabled(true)
await RecommendationHandler.instance.clearInlineCompletionStates()
}
Expand Down

0 comments on commit 8d16b78

Please sign in to comment.