mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	bpo-31510: Fix multiprocessing test_many_processes() on macOS (#3857)
On macOS, a process can exit with -SIGKILL if it is killed "early" with SIGTERM.
This commit is contained in:
		
							parent
							
								
									4337a0d995
								
							
						
					
					
						commit
						e6cfdefa0c
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -501,8 +501,13 @@ def test_many_processes(self):
 | 
			
		|||
        for p in procs:
 | 
			
		||||
            join_process(p)
 | 
			
		||||
        if os.name != 'nt':
 | 
			
		||||
            exitcodes = [-signal.SIGTERM]
 | 
			
		||||
            if sys.platform == 'darwin':
 | 
			
		||||
                # bpo-31510: On macOS, killing a freshly started process with
 | 
			
		||||
                # SIGTERM sometimes kills the process with SIGKILL.
 | 
			
		||||
                exitcodes.append(-signal.SIGKILL)
 | 
			
		||||
            for p in procs:
 | 
			
		||||
                self.assertEqual(p.exitcode, -signal.SIGTERM)
 | 
			
		||||
                self.assertIn(p.exitcode, exitcodes)
 | 
			
		||||
 | 
			
		||||
    def test_lose_target_ref(self):
 | 
			
		||||
        c = DummyCallable()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue