mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	[3.13] gh-120039: Reduce expected timeout in test_siginterrupt_off (GH-120047) (#120060)
The process is expected to time out. In the refleak builds,
`support.SHORT_TIMEOUT` is often five minutes and we run the tests six
times, so test_signal was taking >30 minutes.
(cherry picked from commit d419d468ff)
Co-authored-by: Sam Gross <colesbury@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									8d74eae4d4
								
							
						
					
					
						commit
						fd5428d2d1
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -698,7 +698,7 @@ def handler(signum, frame):
 | 
				
			||||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
 | 
					@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
 | 
				
			||||||
class SiginterruptTest(unittest.TestCase):
 | 
					class SiginterruptTest(unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def readpipe_interrupted(self, interrupt):
 | 
					    def readpipe_interrupted(self, interrupt, timeout=support.SHORT_TIMEOUT):
 | 
				
			||||||
        """Perform a read during which a signal will arrive.  Return True if the
 | 
					        """Perform a read during which a signal will arrive.  Return True if the
 | 
				
			||||||
        read is interrupted by the signal and raises an exception.  Return False
 | 
					        read is interrupted by the signal and raises an exception.  Return False
 | 
				
			||||||
        if it returns normally.
 | 
					        if it returns normally.
 | 
				
			||||||
| 
						 | 
					@ -746,7 +746,7 @@ def handler(signum, frame):
 | 
				
			||||||
                # wait until the child process is loaded and has started
 | 
					                # wait until the child process is loaded and has started
 | 
				
			||||||
                first_line = process.stdout.readline()
 | 
					                first_line = process.stdout.readline()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stdout, stderr = process.communicate(timeout=support.SHORT_TIMEOUT)
 | 
					                stdout, stderr = process.communicate(timeout=timeout)
 | 
				
			||||||
            except subprocess.TimeoutExpired:
 | 
					            except subprocess.TimeoutExpired:
 | 
				
			||||||
                process.kill()
 | 
					                process.kill()
 | 
				
			||||||
                return False
 | 
					                return False
 | 
				
			||||||
| 
						 | 
					@ -777,7 +777,7 @@ def test_siginterrupt_off(self):
 | 
				
			||||||
        # If a signal handler is installed and siginterrupt is called with
 | 
					        # If a signal handler is installed and siginterrupt is called with
 | 
				
			||||||
        # a false value for the second argument, when that signal arrives, it
 | 
					        # a false value for the second argument, when that signal arrives, it
 | 
				
			||||||
        # does not interrupt a syscall that's in progress.
 | 
					        # does not interrupt a syscall that's in progress.
 | 
				
			||||||
        interrupted = self.readpipe_interrupted(False)
 | 
					        interrupted = self.readpipe_interrupted(False, timeout=2)
 | 
				
			||||||
        self.assertFalse(interrupted)
 | 
					        self.assertFalse(interrupted)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue