@@ -577,35 +577,41 @@ for i in range(0, 100):
577
577
578
578
runTest (
579
579
'Interrupt double' ,
580
- async ( ) => {
581
- let interruptedKernel = false ;
582
- const { window, mount } = await getOrCreateInteractiveWindow ( ioc ) ;
583
- window . notebook ?. onKernelInterrupted ( ( ) => ( interruptedKernel = true ) ) ;
584
-
585
- let timerCount = 0 ;
586
- addContinuousMockData ( ioc , interruptCode , async ( _c ) => {
587
- timerCount += 1 ;
588
- await sleep ( 0.5 ) ;
589
- return Promise . resolve ( { result : '' , haveMore : timerCount < 100 } ) ;
590
- } ) ;
580
+ async ( context : Mocha . Context ) => {
581
+ if ( ioc . mockJupyter ) {
582
+ let interruptedKernel = false ;
583
+ const { window, mount } = await getOrCreateInteractiveWindow ( ioc ) ;
584
+ window . notebook ?. onKernelInterrupted ( ( ) => ( interruptedKernel = true ) ) ;
585
+
586
+ let timerCount = 0 ;
587
+ addContinuousMockData ( ioc , interruptCode , async ( _c ) => {
588
+ timerCount += 1 ;
589
+ await sleep ( 0.5 ) ;
590
+ return Promise . resolve ( { result : '' , haveMore : timerCount < 100 } ) ;
591
+ } ) ;
591
592
592
- addMockData ( ioc , interruptCode , undefined , 'text/plain' ) ;
593
+ addMockData ( ioc , interruptCode , undefined , 'text/plain' ) ;
593
594
594
- // Run the interrupt code and then interrupt it twice to make sure we can interrupt twice
595
- const waitForAdd = addCode ( ioc , interruptCode ) ;
595
+ // Run the interrupt code and then interrupt it twice to make sure we can interrupt twice
596
+ const waitForAdd = addCode ( ioc , interruptCode ) ;
596
597
597
- // 'Click' the button in the react control. We need to verify we can
598
- // click it more than once.
599
- const interrupt = findButton ( mount . wrapper , InteractivePanel , 4 ) ;
600
- interrupt ?. simulate ( 'click' ) ;
601
- await sleep ( 0.1 ) ;
602
- interrupt ?. simulate ( 'click' ) ;
598
+ // 'Click' the button in the react control. We need to verify we can
599
+ // click it more than once.
600
+ const interrupt = findButton ( mount . wrapper , InteractivePanel , 4 ) ;
601
+ interrupt ?. simulate ( 'click' ) ;
602
+ await sleep ( 0.1 ) ;
603
+ interrupt ?. simulate ( 'click' ) ;
603
604
604
- // We should get out of the wait for add
605
- await waitForAdd ;
605
+ // We should get out of the wait for add
606
+ await waitForAdd ;
606
607
607
- // We should have also fired an interrupt
608
- assert . ok ( interruptedKernel , 'Kernel was not interrupted' ) ;
608
+ // We should have also fired an interrupt
609
+ assert . ok ( interruptedKernel , 'Kernel was not interrupted' ) ;
610
+ } else {
611
+ // Timing is too iffy for real jupyter. However we really just
612
+ // want to make sure double interrupt is supported so keep the test.
613
+ context . skip ( ) ;
614
+ }
609
615
} ,
610
616
( ) => {
611
617
return ioc ;
0 commit comments