mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Issue #26588: add debug traces
Try to debug random failure on buildbots.
This commit is contained in:
		
							parent
							
								
									24f949e10c
								
							
						
					
					
						commit
						84aab09421
					
				
					 3 changed files with 59 additions and 5 deletions
				
			
		|  | @ -88,6 +88,9 @@ def traceback_filename(filename): | |||
| 
 | ||||
| class TestTracemallocEnabled(unittest.TestCase): | ||||
|     def setUp(self): | ||||
|         if _testcapi: | ||||
|             _testcapi.tracemalloc_set_debug(True) | ||||
| 
 | ||||
|         if tracemalloc.is_tracing(): | ||||
|             self.skipTest("tracemalloc must be stopped before the test") | ||||
| 
 | ||||
|  | @ -95,6 +98,8 @@ def setUp(self): | |||
| 
 | ||||
|     def tearDown(self): | ||||
|         tracemalloc.stop() | ||||
|         if _testcapi: | ||||
|             _testcapi.tracemalloc_set_debug(False) | ||||
| 
 | ||||
|     def test_get_tracemalloc_memory(self): | ||||
|         data = [allocate_bytes(123) for count in range(1000)] | ||||
|  | @ -877,6 +882,9 @@ class TestCAPI(unittest.TestCase): | |||
|     maxDiff = 80 * 20 | ||||
| 
 | ||||
|     def setUp(self): | ||||
|         if _testcapi: | ||||
|             _testcapi.tracemalloc_set_debug(True) | ||||
| 
 | ||||
|         if tracemalloc.is_tracing(): | ||||
|             self.skipTest("tracemalloc must be stopped before the test") | ||||
| 
 | ||||
|  | @ -890,6 +898,8 @@ def setUp(self): | |||
| 
 | ||||
|     def tearDown(self): | ||||
|         tracemalloc.stop() | ||||
|         if _testcapi: | ||||
|             _testcapi.tracemalloc_set_debug(False) | ||||
| 
 | ||||
|     def get_traceback(self): | ||||
|         frames = _testcapi.tracemalloc_get_traceback(self.domain, self.ptr) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner