@@ -17,6 +17,7 @@ import { PlatformService } from '../../client/common/platform/platformService';
1717import { LaunchRequestArguments } from '../../client/debugger/Common/Contracts' ;
1818import { sleep } from '../common' ;
1919import { IS_MULTI_ROOT_TEST , TEST_DEBUGGER } from '../initialize' ;
20+ import { DEBUGGER_TIMEOUT } from './common/constants' ;
2021import { DebugClientEx } from './debugClient' ;
2122
2223const isProcessRunning = require ( 'is-running' ) as ( number ) = > boolean ;
@@ -28,7 +29,6 @@ const debugFilesPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'py
2829const DEBUG_ADAPTER = path . join ( __dirname , '..' , '..' , 'client' , 'debugger' , 'Main.js' ) ;
2930const MAX_SIGNED_INT32 = Math . pow ( 2 , 31 ) - 1 ;
3031const EXPERIMENTAL_DEBUG_ADAPTER = path . join ( __dirname , '..' , '..' , 'client' , 'debugger' , 'mainV2.js' ) ;
31- const THREAD_TIMEOUT = 10000 ;
3232
3333let testCounter = 0 ;
3434[ DEBUG_ADAPTER , EXPERIMENTAL_DEBUG_ADAPTER ] . forEach ( testAdapterFilePath => {
@@ -43,6 +43,7 @@ let testCounter = 0;
4343 }
4444 await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ;
4545 debugClient = createDebugAdapter ( ) ;
46+ debugClient . defaultTimeout = DEBUGGER_TIMEOUT ;
4647 await debugClient . start ( ) ;
4748 } ) ;
4849 teardown ( async ( ) => {
@@ -137,7 +138,7 @@ let testCounter = 0;
137138 if ( debuggerType !== 'python' ) {
138139 return this . skip ( ) ;
139140 }
140- const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
141+ const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
141142
142143 await Promise . all ( [
143144 debugClient . configurationSequence ( ) ,
@@ -156,7 +157,7 @@ let testCounter = 0;
156157 if ( debuggerType !== 'python' ) {
157158 return this . skip ( ) ;
158159 }
159- const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
160+ const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
160161
161162 await Promise . all ( [
162163 debugClient . configurationSequence ( ) ,
@@ -183,7 +184,7 @@ let testCounter = 0;
183184 }
184185 const launchArgs = buildLauncArgs ( 'sample2.py' , false ) ;
185186 const breakpointLocation = { path : path . join ( debugFilesPath , 'sample2.py' ) , column : 1 , line : 5 } ;
186- const processPromise = debugClient . waitForEvent ( 'process' , THREAD_TIMEOUT ) as Promise < DebugProtocol . ProcessEvent > ;
187+ const processPromise = debugClient . waitForEvent ( 'process' ) as Promise < DebugProtocol . ProcessEvent > ;
187188 await debugClient . hitBreakpoint ( launchArgs , breakpointLocation ) ;
188189 const processInfo = await processPromise ;
189190 const processId = processInfo . body . systemProcessId ;
@@ -196,7 +197,7 @@ let testCounter = 0;
196197 expect ( isProcessRunning ( processId ) ) . to . be . equal ( false , 'Python (debugee) Process is still alive' ) ;
197198 } ) ;
198199 test ( 'Test conditional breakpoints' , async ( ) => {
199- const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
200+ const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
200201
201202 await Promise . all ( [
202203 debugClient . configurationSequence ( ) ,
@@ -227,7 +228,7 @@ let testCounter = 0;
227228 expect ( vari . value ) . to . be . equal ( '3' ) ;
228229 } ) ;
229230 test ( 'Test variables' , async ( ) => {
230- const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
231+ const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
231232 await Promise . all ( [
232233 debugClient . configurationSequence ( ) ,
233234 debugClient . launch ( buildLauncArgs ( 'sample2.py' , false ) ) ,
@@ -297,7 +298,7 @@ let testCounter = 0;
297298 expect ( response . body . value ) . to . be . equal ( '1234' ) ;
298299 } ) ;
299300 test ( 'Test evaluating expressions' , async ( ) => {
300- const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
301+ const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
301302
302303 await Promise . all ( [
303304 debugClient . configurationSequence ( ) ,
@@ -323,7 +324,7 @@ let testCounter = 0;
323324 expect ( response . body . result ) . to . be . equal ( '6' , 'expression value is incorrect' ) ;
324325 } ) ;
325326 test ( 'Test stepover' , async ( ) => {
326- const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
327+ const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
327328
328329 await Promise . all ( [
329330 debugClient . configurationSequence ( ) ,
@@ -361,7 +362,7 @@ let testCounter = 0;
361362 ] ) ;
362363 } ) ;
363364 test ( 'Test stepin and stepout' , async ( ) => {
364- const threadIdPromise = debugClient . waitForEvent ( 'thread' , THREAD_TIMEOUT ) ;
365+ const threadIdPromise = debugClient . waitForEvent ( 'thread' ) ;
365366
366367 await Promise . all ( [
367368 debugClient . configurationSequence ( ) ,
@@ -418,7 +419,7 @@ let testCounter = 0;
418419 debugClient . configurationSequence ( ) ,
419420 debugClient . launch ( buildLauncArgs ( 'forever.py' , false ) ) ,
420421 debugClient . waitForEvent ( 'initialized' ) ,
421- debugClient . waitForEvent ( 'process' , THREAD_TIMEOUT )
422+ debugClient . waitForEvent ( 'process' )
422423 ] ) ;
423424
424425 await sleep ( 3 ) ;
0 commit comments