Commit 0cd4097
committed
gh-140381: Make test_profiling tests deterministic to fix flakiness
The test_sampling_basic_functionality, test_sample_target_script, and
test_sample_target_module tests were failing intermittently on slow
architectures (i686/s390x) because they relied on a time-based workload
with an infinite loop (while True). On slow machines, the profiler's
sampling window would end before enough iterations executed, causing
slow_fibonacci to not appear in the profiling output.1 parent 17636ba commit 0cd4097
File tree
1 file changed
+12
-4
lines changed- Lib/test/test_profiling/test_sampling_profiler
1 file changed
+12
-4
lines changedLines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
405 | 409 | | |
406 | 410 | | |
407 | 411 | | |
| 412 | + | |
| 413 | + | |
408 | 414 | | |
409 | 415 | | |
410 | | - | |
| 416 | + | |
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
| |||
434 | 440 | | |
435 | 441 | | |
436 | 442 | | |
| 443 | + | |
437 | 444 | | |
438 | 445 | | |
439 | | - | |
| 446 | + | |
440 | 447 | | |
441 | 448 | | |
442 | 449 | | |
| |||
578 | 585 | | |
579 | 586 | | |
580 | 587 | | |
581 | | - | |
| 588 | + | |
| 589 | + | |
582 | 590 | | |
583 | 591 | | |
584 | 592 | | |
| |||
612 | 620 | | |
613 | 621 | | |
614 | 622 | | |
615 | | - | |
| 623 | + | |
616 | 624 | | |
617 | 625 | | |
618 | 626 | | |
| |||
0 commit comments