Skip to content

Commit bc45007

Browse files
committed
Loosen requirement for native frames in the middle of the stack
1 parent f2b6607 commit bc45007

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,13 +3172,18 @@ def test_native_frames_enabled(self):
31723172
# Check file format
31733173
with open(collapsed_file.name, "r") as f:
31743174
content = f.read()
3175+
31753176
lines = content.strip().split("\n")
31763177
self.assertGreater(len(lines), 0)
3178+
31773179
stacks = [line.rsplit(" ", 1)[0] for line in lines]
3178-
# All samples should have native code in the middle of the stack:
3179-
self.assertTrue(all(";<native>;" in stack for stack in stacks))
3180+
3181+
# Most samples should have native code in the middle of the stack:
3182+
self.assertTrue(any(";<native>;" in stack for stack in stacks))
3183+
31803184
# Some samples should have native code at the top of the stack:
31813185
self.assertTrue(any(stack.endswith(";<native>") for stack in stacks))
3186+
31823187
# Some samples should have Python code at the top of the stack:
31833188
self.assertTrue(any(not stack.endswith(";<native>") for stack in stacks))
31843189

0 commit comments

Comments
 (0)