File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
core/src/test/codewhisperer Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff 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 ( )
Original file line number Diff line number Diff line change @@ -28,13 +28,15 @@ import * as model from '../../codewhisperer/models/model'
2828import { stub } from '../utilities/stubber'
2929import { 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}
You can’t perform that action at this time.
0 commit comments