From f15f6d0ba3715c67643e58959459b0e84a67b183 Mon Sep 17 00:00:00 2001 From: Paresh Joshi Date: Fri, 21 Nov 2025 21:31:26 +0530 Subject: [PATCH] gh-141612: improve `test_trampoline_works_with_forks` coverage (#141613) --- Lib/test/test_perf_profiler.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Lib/test/test_perf_profiler.py b/Lib/test/test_perf_profiler.py index e6852c93e69..66348619073 100644 --- a/Lib/test/test_perf_profiler.py +++ b/Lib/test/test_perf_profiler.py @@ -160,6 +160,16 @@ def baz(): 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):