Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit c920eac

Browse files
committed
erge branch 'main' into oct_15_comment
2 parents ba7e350 + e3ce048 commit c920eac

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

utils/test_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
def slow_test_threshold(total_tests: int) -> int:
3434
percentile = (100 - SLOW_TEST_PERCENTILE) / 100
3535
slow_tests_to_return = floor(percentile * total_tests)
36-
return max(slow_tests_to_return, 1)
36+
return min(max(slow_tests_to_return, 1), 100)
3737

3838

3939
class ArrayLength(Func):
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pytest
2+
3+
from utils.test_results import slow_test_threshold
4+
5+
6+
@pytest.mark.parametrize(
7+
"total_tests, expected_threshold",
8+
[
9+
(0, 1),
10+
(1, 1),
11+
(10, 1),
12+
(100, 5),
13+
(1000, 50),
14+
(10000, 100),
15+
(1000000, 100),
16+
(20, 1),
17+
(50, 2),
18+
(200, 10),
19+
(2000, 100),
20+
],
21+
)
22+
def test_slow_test_threshold(total_tests, expected_threshold):
23+
assert slow_test_threshold(total_tests) == expected_threshold

0 commit comments

Comments
 (0)