@@ -14,7 +14,6 @@ import { noop } from '../../client/common/core.utils';
14
14
import { IS_WINDOWS } from '../../client/common/platform/constants' ;
15
15
import { FileSystem } from '../../client/common/platform/fileSystem' ;
16
16
import { PlatformService } from '../../client/common/platform/platformService' ;
17
- import { StopWatch } from '../../client/common/stopWatch' ;
18
17
import { DebugOptions , LaunchRequestArguments } from '../../client/debugger/Common/Contracts' ;
19
18
import { sleep } from '../common' ;
20
19
import { IS_MULTI_ROOT_TEST , TEST_DEBUGGER } from '../initialize' ;
@@ -42,7 +41,6 @@ let testCounter = 0;
42
41
if ( ! IS_MULTI_ROOT_TEST || ! TEST_DEBUGGER ) {
43
42
this . skip ( ) ;
44
43
}
45
- this . timeout ( 30000 ) ;
46
44
await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ;
47
45
debugClient = createDebugAdapter ( ) ;
48
46
debugClient . defaultTimeout = DEBUGGER_TIMEOUT ;
@@ -447,37 +445,30 @@ let testCounter = 0;
447
445
const pauseLocation = { path : path . join ( debugFilesPath , 'sample3WithEx.py' ) , line : 5 } ;
448
446
await debugClient . assertStoppedLocation ( 'exception' , pauseLocation ) ;
449
447
} ) ;
450
- test ( 'Test multi-threaded debugging' , async ( ) => {
451
- const stopWatch = new StopWatch ( ) ;
452
- console . log ( `step1 ${ stopWatch . elapsedTime } ` ) ;
448
+ test ( 'Test multi-threaded debugging' , async function ( ) {
449
+ this . timeout ( 30000 ) ;
453
450
await Promise . all ( [
454
451
debugClient . configurationSequence ( ) ,
455
452
debugClient . launch ( buildLauncArgs ( 'multiThread.py' , false ) ) ,
456
453
debugClient . waitForEvent ( 'initialized' )
457
454
] ) ;
458
- debugClient . addListener ( 'output' , output => {
459
- console . log ( `stepx ${ stopWatch . elapsedTime } , ${ JSON . stringify ( output ) } ` ) ;
460
- } ) ;
461
- console . log ( `step2 ${ stopWatch . elapsedTime } ` ) ;
455
+
456
+ // Add a delay for debugger to start (sometimes it takes a long time for new debugger to break).
462
457
await sleep ( 3000 ) ;
463
458
const pythonFile = path . join ( debugFilesPath , 'multiThread.py' ) ;
464
- const breakpointLocation = { path : pythonFile , column : 1 , line : 15 } ;
459
+ const breakpointLocation = { path : pythonFile , column : 1 , line : 11 } ;
465
460
await debugClient . setBreakpointsRequest ( {
466
461
lines : [ breakpointLocation . line ] ,
467
462
breakpoints : [ { line : breakpointLocation . line , column : breakpointLocation . column } ] ,
468
463
source : { path : breakpointLocation . path }
469
464
} ) ;
470
- console . log ( `step3 ${ stopWatch . elapsedTime } ` ) ;
471
- // hit breakpoint.
465
+
472
466
await debugClient . assertStoppedLocation ( 'breakpoint' , breakpointLocation ) ;
473
- console . log ( `step4 ${ stopWatch . elapsedTime } ` ) ;
474
467
const threads = await debugClient . threadsRequest ( ) ;
475
- console . log ( `step5 ${ stopWatch . elapsedTime } ` ) ;
476
468
expect ( threads . body . threads ) . of . lengthOf ( 2 , 'incorrect number of threads' ) ;
477
469
for ( const thread of threads . body . threads ) {
478
470
expect ( thread . id ) . to . be . lessThan ( MAX_SIGNED_INT32 + 1 , 'ThreadId is not an integer' ) ;
479
471
}
480
- console . log ( `step6 ${ stopWatch . elapsedTime } ` ) ;
481
472
} ) ;
482
473
test ( 'Test stack frames' , async ( ) => {
483
474
await Promise . all ( [
0 commit comments