Open
Description
test_int
recently failed on a buildbot:
======================================================================
FAIL: test_denial_of_service_prevented_str_to_int (test.test_int.IntSubclassStrDigitLimitsTests.test_denial_of_service_prevented_str_to_int)
Regression test: ensure we fail before performing O(N**2) work.
----------------------------------------------------------------------
Traceback (most recent call last):
File "b:\uildarea\3.12.ware-win11.nondebug\build\Lib\test\test_int.py", line 743, in test_denial_of_service_prevented_str_to_int
self.assertLessEqual(seconds_to_fail_extra_huge, seconds_to_convert/2)
AssertionError: 0.015625 not less than or equal to 0.0078125
I don't know for sure, but my guess is that a GC collection got triggered at the wrong time.
I'd like to add a test helper for timing CPU-bound tasks. It should disable GC and use process_time
; perhaps it can do other tricks in the future too.