]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141612: improve `test_trampoline_works_with_forks` coverage (#141613)
authorParesh Joshi <rahulj9223@gmail.com>
Fri, 21 Nov 2025 16:01:26 +0000 (21:31 +0530)
committerGitHub <noreply@github.com>
Fri, 21 Nov 2025 16:01:26 +0000 (16:01 +0000)
Lib/test/test_perf_profiler.py

index e6852c93e69830ce9220c719f8af4cca33dc61ea..66348619073909ca74a8e290a594712bc8bb0960 100644 (file)
@@ -160,6 +160,16 @@ class TestPerfTrampoline(unittest.TestCase):
         self.assertIn(f"py::bar_fork:{script}", child_perf_file_contents)
         self.assertIn(f"py::baz_fork:{script}", child_perf_file_contents)
 
+        # The parent's map should not contain the child's symbols.
+        self.assertNotIn(f"py::foo_fork:{script}", perf_file_contents)
+        self.assertNotIn(f"py::bar_fork:{script}", perf_file_contents)
+        self.assertNotIn(f"py::baz_fork:{script}", perf_file_contents)
+
+        # The child's map should not contain the parent's symbols.
+        self.assertNotIn(f"py::foo:{script}", child_perf_file_contents)
+        self.assertNotIn(f"py::bar:{script}", child_perf_file_contents)
+        self.assertNotIn(f"py::baz:{script}", child_perf_file_contents)
+
     @unittest.skipIf(support.check_bolt_optimized(), "fails on BOLT instrumented binaries")
     def test_sys_api(self):
         for define_eval_hook in (False, True):