Skip to content

Commit abf1337

Browse files
committed
Simplify the test
1 parent c31c6dc commit abf1337

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,17 +3122,15 @@ def setUpClass(cls):
31223122
cls.native_test_script = '''
31233123
import operator
31243124
3125-
def python_to_c():
3126-
# Native code at the top of the stack:
3127-
sum(range(100))
3128-
# Python code at the top of the stack:
3129-
for _ in range(100):
3130-
pass
3131-
31323125
def main_loop():
31333126
while True:
31343127
# Native code in the middle of the stack:
3135-
operator.call(python_to_c)
3128+
operator.call(inner)
3129+
3130+
def inner():
3131+
# A mixture of native and Python code at the top of the stack:
3132+
for _ in range(1_000_0000):
3133+
pass
31363134
31373135
if __name__ == "__main__":
31383136
main_loop()
@@ -3156,7 +3154,7 @@ def test_native_frames_enabled(self):
31563154
try:
31573155
profiling.sampling.sample.sample(
31583156
subproc.process.pid,
3159-
duration_sec=2,
3157+
duration_sec=1,
31603158
filename=collapsed_file.name,
31613159
output_format="collapsed",
31623160
sample_interval_usec=1000,

0 commit comments

Comments
 (0)