mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	gh-109580: Skip test_perf_profiler on ASAN build (#109584)
Skip test_perf_profiler if Python is built with ASAN, MSAN or UBSAN sanitizer. Python does crash randomly in this test on such build.
This commit is contained in:
		
							parent
							
								
									9df6712c12
								
							
						
					
					
						commit
						754519a9f8
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		| 
						 | 
					@ -17,6 +17,11 @@ from test.support.os_helper import temp_dir
 | 
				
			||||||
if not support.has_subprocess_support:
 | 
					if not support.has_subprocess_support:
 | 
				
			||||||
    raise unittest.SkipTest("test module requires subprocess")
 | 
					    raise unittest.SkipTest("test module requires subprocess")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if support.check_sanitizer(address=True, memory=True, ub=True):
 | 
				
			||||||
 | 
					    # gh-109580: Skip the test because it does crash randomly if Python is
 | 
				
			||||||
 | 
					    # built with ASAN.
 | 
				
			||||||
 | 
					    raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def supports_trampoline_profiling():
 | 
					def supports_trampoline_profiling():
 | 
				
			||||||
    perf_trampoline = sysconfig.get_config_var("PY_HAVE_PERF_TRAMPOLINE")
 | 
					    perf_trampoline = sysconfig.get_config_var("PY_HAVE_PERF_TRAMPOLINE")
 | 
				
			||||||
| 
						 | 
					@ -287,7 +292,6 @@ def run_perf(cwd, *args, **env_vars):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@unittest.skipUnless(perf_command_works(), "perf command doesn't work")
 | 
					@unittest.skipUnless(perf_command_works(), "perf command doesn't work")
 | 
				
			||||||
@unittest.skipUnless(is_unwinding_reliable(), "Unwinding is unreliable")
 | 
					@unittest.skipUnless(is_unwinding_reliable(), "Unwinding is unreliable")
 | 
				
			||||||
@support.skip_if_sanitizer(address=True, memory=True, ub=True)
 | 
					 | 
				
			||||||
class TestPerfProfiler(unittest.TestCase):
 | 
					class TestPerfProfiler(unittest.TestCase):
 | 
				
			||||||
    def setUp(self):
 | 
					    def setUp(self):
 | 
				
			||||||
        super().setUp()
 | 
					        super().setUp()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					Skip ``test_perf_profiler`` if Python is built with ASAN, MSAN or UBSAN
 | 
				
			||||||
 | 
					sanitizer. Python does crash randomly in this test on such build. Patch by
 | 
				
			||||||
 | 
					Victor Stinner.
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue