@@ -41,6 +41,7 @@ import { JVSC_EXTENSION_ID } from '../../../platform/common/constants';
41
41
import { escapeStringToEmbedInPythonCode } from '../../../kernels/chat/generator' ;
42
42
import { notebookCellExecutions } from '../../../platform/notebooks/cellExecutionStateService' ;
43
43
import { createKernelApiForExtension } from './kernel' ;
44
+ import { noop } from '../../../test/core' ;
44
45
45
46
suiteMandatory ( 'Kernel API Tests @typescript' , function ( ) {
46
47
const disposables : IDisposable [ ] = [ ] ;
@@ -203,7 +204,14 @@ suiteMandatory('Kernel API Tests @typescript', function () {
203
204
} )
204
205
) ;
205
206
206
- await realKernel . start ( ) ;
207
+ await realKernel . start ( {
208
+ disableUI : true ,
209
+ onDidChangeDisableUI : ( ) => ( {
210
+ dispose : noop
211
+ } )
212
+ } ) ;
213
+ assert . equal ( startEventCounter , 0 ) ;
214
+
207
215
const kernel = createKernelApiForExtension ( JVSC_EXTENSION_ID_FOR_TESTS , realKernel ) ;
208
216
209
217
logger . info ( `Execute code silently` ) ;
@@ -226,12 +234,16 @@ suiteMandatory('Kernel API Tests @typescript', function () {
226
234
disposables . push (
227
235
kernels . onDidStart ( ( { kernel } ) => {
228
236
startEventCounter ++ ;
229
- kernel . executeCode ( `foo = ${ startEventCounter } ` , source . token ) ;
237
+ const codeToRun =
238
+ startEventCounter === 0 ? `let foo = ${ startEventCounter } ` : `foo = ${ startEventCounter } ` ;
239
+ kernel . executeCode ( codeToRun , source . token ) ;
230
240
} )
231
241
) ;
232
242
await insertCodeCell ( 'console.log(foo)' , { index : 0 , language : 'typescript' } ) ;
233
243
234
244
await realKernel . start ( ) ;
245
+ assert . equal ( startEventCounter , 1 ) ;
246
+
235
247
const cell = notebook . cellAt ( 0 ) ! ;
236
248
const executionOrderSet = createDeferred ( ) ;
237
249
const eventHandler = notebookCellExecutions . onDidChangeNotebookCellExecutionState ( ( e ) => {
0 commit comments