File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed 
src/libraries/System.Diagnostics.Process/tests Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1118,6 +1118,18 @@ public void TestGetProcessById()
11181118            Assert . Equal ( _process . ProcessName ,  p . ProcessName ) ; 
11191119        } 
11201120
1121+         [ ConditionalFact ( typeof ( RemoteExecutor ) ,  nameof ( RemoteExecutor . IsSupported ) ) ] 
1122+         public  void  GetProcessById_KilledProcess_ThrowsArgumentException ( ) 
1123+         { 
1124+             Process  process  =  CreateDefaultProcess ( ) ; 
1125+             var  handle  =  process . SafeHandle ; 
1126+             int  processId  =  process . Id ; 
1127+             process . Kill ( ) ; 
1128+             process . WaitForExit ( WaitInMS ) ; 
1129+             Assert . Throws < ArgumentException > ( ( )  =>  Process . GetProcessById ( processId ) ) ; 
1130+             GC . KeepAlive ( handle ) ; 
1131+         } 
1132+ 
11211133        [ Fact ] 
11221134        [ SkipOnPlatform ( TestPlatforms . iOS  |  TestPlatforms . tvOS ,  "libproc is not supported on iOS/tvOS" ) ] 
11231135        public  void  TestGetProcesses ( ) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments