@@ -22,6 +22,7 @@ const debugFilesPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'py
22
22
const DEBUG_ADAPTER = path . join ( __dirname , '..' , '..' , 'client' , 'debugger' , 'Main.js' ) ;
23
23
const MAX_SIGNED_INT32 = Math . pow ( 2 , 31 ) - 1 ;
24
24
const EXPERIMENTAL_DEBUG_ADAPTER = path . join ( __dirname , '..' , '..' , 'client' , 'debugger' , 'mainV2.js' ) ;
25
+ const THREAD_TIMEOUT = 10000 ;
25
26
26
27
[ DEBUG_ADAPTER , EXPERIMENTAL_DEBUG_ADAPTER ] . forEach ( testAdapterFilePath => {
27
28
const debugAdapterFileName = path . basename ( testAdapterFilePath ) ;
@@ -119,7 +120,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
119
120
if ( debuggerType !== 'python' ) {
120
121
return this . skip ( ) ;
121
122
}
122
- const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
123
+ const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
123
124
124
125
await Promise . all ( [
125
126
debugClient . configurationSequence ( ) ,
@@ -138,7 +139,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
138
139
if ( debuggerType !== 'python' ) {
139
140
return this . skip ( ) ;
140
141
}
141
- const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
142
+ const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
142
143
143
144
await Promise . all ( [
144
145
debugClient . configurationSequence ( ) ,
@@ -165,7 +166,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
165
166
}
166
167
const launchArgs = buildLauncArgs ( 'sample2.py' , false ) ;
167
168
const breakpointLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 5 } ;
168
- const processPromise = debugClient . waitForEvent ( 'process' ) as Promise < DebugProtocol . ProcessEvent > ;
169
+ const processPromise = debugClient . waitForEvent ( 'process' , THREAD_TIMEOUT ) as Promise < DebugProtocol . ProcessEvent > ;
169
170
await debugClient . hitBreakpoint ( launchArgs , breakpointLocation ) ;
170
171
const processInfo = await processPromise ;
171
172
const processId = processInfo . body . systemProcessId ;
@@ -178,7 +179,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
178
179
expect ( isProcessRunning ( processId ) ) . to . be . equal ( false , 'Python (debugee) Process is still alive' ) ;
179
180
} ) ;
180
181
test ( 'Test conditional breakpoints' , async ( ) => {
181
- const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
182
+ const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
182
183
183
184
await Promise . all ( [
184
185
debugClient . configurationSequence ( ) ,
@@ -209,7 +210,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
209
210
expect ( vari . value ) . to . be . equal ( '3' ) ;
210
211
} ) ;
211
212
test ( 'Test variables' , async ( ) => {
212
- const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
213
+ const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
213
214
await Promise . all ( [
214
215
debugClient . configurationSequence ( ) ,
215
216
debugClient . launch ( buildLauncArgs ( 'sample2.py' , false ) ) ,
@@ -279,7 +280,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
279
280
expect ( response . body . value ) . to . be . equal ( '1234' ) ;
280
281
} ) ;
281
282
test ( 'Test evaluating expressions' , async ( ) => {
282
- const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
283
+ const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
283
284
284
285
await Promise . all ( [
285
286
debugClient . configurationSequence ( ) ,
@@ -305,7 +306,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
305
306
expect ( response . body . result ) . to . be . equal ( '6' , 'expression value is incorrect' ) ;
306
307
} ) ;
307
308
test ( 'Test stepover' , async ( ) => {
308
- const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
309
+ const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
309
310
310
311
await Promise . all ( [
311
312
debugClient . configurationSequence ( ) ,
@@ -337,7 +338,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
337
338
await debugClient . assertStoppedLocation ( 'step' , printLocation ) ;
338
339
} ) ;
339
340
test ( 'Test stepin and stepout' , async ( ) => {
340
- const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
341
+ const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
341
342
342
343
await Promise . all ( [
343
344
debugClient . configurationSequence ( ) ,
@@ -376,14 +377,16 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
376
377
await debugClient . assertStoppedLocation ( 'step' , printLocation ) ;
377
378
} ) ;
378
379
test ( 'Test pausing' , async function ( ) {
379
- if ( debuggerType !== 'python' ) {
380
+ // TODO: re-enable for new debugger once it's running on CI
381
+ if ( debuggerType !== 'pythonExperimental' || IS_CI_SERVER ) {
380
382
return this . skip ( ) ;
381
383
}
382
384
383
385
await Promise . all ( [
384
386
debugClient . configurationSequence ( ) ,
385
387
debugClient . launch ( buildLauncArgs ( 'forever.py' , false ) ) ,
386
- debugClient . waitForEvent ( 'initialized' )
388
+ debugClient . waitForEvent ( 'initialized' ) ,
389
+ debugClient . waitForEvent ( 'process' , THREAD_TIMEOUT )
387
390
] ) ;
388
391
389
392
await sleep ( 3 ) ;
@@ -399,6 +402,7 @@ const EXPERIMENTAL_DEBUG_ADAPTER = path.join(__dirname, '..', '..', 'client', 'd
399
402
if ( debuggerType !== 'python' ) {
400
403
return this . skip ( ) ;
401
404
}
405
+
402
406
await Promise . all ( [
403
407
debugClient . configurationSequence ( ) ,
404
408
debugClient . launch ( buildLauncArgs ( 'sample3WithEx.py' , false ) ) ,
0 commit comments