@@ -59,12 +59,11 @@ public void Dispose()
5959        { 
6060            debugService . Abort ( ) ; 
6161            _psesHost . StopAsync ( ) . GetAwaiter ( ) . GetResult ( ) ; 
62-             GC . SuppressFinalize ( this ) ; 
6362        } 
6463
6564        private  void  DebugService_DebuggerStopped ( object  sender ,  DebuggerStoppedEventArgs  e ) 
6665        { 
67-             _   =   Task . Run ( ( )   =>   debuggerStoppedQueue . Add ( e ) ) ; 
66+             debuggerStoppedQueue . Add ( e ) ; 
6867        } 
6968
7069        private  ScriptFile  GetDebugScript ( string  fileName ) 
@@ -477,13 +476,14 @@ await debugService.SetLineBreakpointsAsync(
477476        } 
478477
479478        [ Trait ( "Category" ,  "DebugService" ) ] 
480-         [ Fact ( Skip   =   "This test has a race condition." ) ] 
479+         [ Fact ] 
481480        public  async  Task  DebuggerBreaksWhenRequested ( ) 
482481        { 
483482            var  confirmedBreakpoints  =  await  GetConfirmedBreakpoints ( debugScriptFile ) . ConfigureAwait ( false ) ; 
484483            Assert . Equal ( 0 ,  confirmedBreakpoints . Count ) ; 
485484            Task  _  =  ExecuteDebugFile ( ) ; 
486-             debugService . Break ( ) ; 
485+             // NOTE: This must be run on a separate thread so the async event handlers can fire. 
486+             await  Task . Run ( ( )  =>  debugService . Break ( ) ) . ConfigureAwait ( false ) ; 
487487            AssertDebuggerPaused ( ) ; 
488488        } 
489489
@@ -492,7 +492,8 @@ public async Task DebuggerBreaksWhenRequested()
492492        public  async  Task  DebuggerRunsCommandsWhileStopped ( ) 
493493        { 
494494            Task  _  =  ExecuteDebugFile ( ) ; 
495-             debugService . Break ( ) ; 
495+             // NOTE: This must be run on a separate thread so the async event handlers can fire. 
496+             await  Task . Run ( ( )  =>  debugService . Break ( ) ) . ConfigureAwait ( false ) ; 
496497            AssertDebuggerPaused ( ) ; 
497498
498499            // Try running a command from outside the pipeline thread 
0 commit comments