Under Python 3.13, random.randint(earliest_in_epoch, latest_in_epoch) in pytest_splunk_addon/sample_generation/rule.py:684 raises TypeError: 'float' object cannot be interpreted as an integer. Python 3.13 tightened random.randrange to reject non-integer arguments outright — on earlier versions (e.g. 3.9) this was only a DeprecationWarning.
This crashes pytest_sessionstart inside AppTestGenerator (via sample_generator.get_samples() → rule.apply() → rule.replace()), so pytest exits with INTERNALERROR, produces no JUnit XML report, and the whole test session fails before any test runs.
Repro: run any TA's knowledge/modinput tests with python-version: 3.13 in wfe-test-runner-action. Example: splunk-add-on-for-microsoft-sysmon run 29721237033, job run-knowledge-tests (10.4.1) — https://github.com/splunk/splunk-add-on-for-microsoft-sysmon/actions/runs/29721237033/job/88285117187
INTERNALERROR> File ".../pytest_splunk_addon/sample_generation/rule.py", line 684, in replace
INTERNALERROR> randint(earliest_in_epoch, latest_in_epoch)
INTERNALERROR> File "/usr/lib/python3.13/random.py", line 340, in randint
INTERNALERROR> return self.randrange(a, b+1)
INTERNALERROR> File "/usr/lib/python3.13/random.py", line 305, in randrange
INTERNALERROR> istart = _index(start)
INTERNALERROR> TypeError: 'float' object cannot be interpreted as an integer
Fix should coerce earliest_in_epoch/latest_in_epoch (and any other randint call sites in this file) to int before calling randint.
Found while validating ADDON-89094's Python 3.9→3.13 bump for addonfactory-workflow-addon-release's v5.6.0 release (ADDON-88923 epic).
Under Python 3.13,
random.randint(earliest_in_epoch, latest_in_epoch)inpytest_splunk_addon/sample_generation/rule.py:684raisesTypeError: 'float' object cannot be interpreted as an integer. Python 3.13 tightenedrandom.randrangeto reject non-integer arguments outright — on earlier versions (e.g. 3.9) this was only aDeprecationWarning.This crashes
pytest_sessionstartinsideAppTestGenerator(viasample_generator.get_samples()→rule.apply()→rule.replace()), so pytest exits withINTERNALERROR, produces no JUnit XML report, and the whole test session fails before any test runs.Repro: run any TA's knowledge/modinput tests with
python-version: 3.13in wfe-test-runner-action. Example: splunk-add-on-for-microsoft-sysmon run 29721237033, jobrun-knowledge-tests (10.4.1)— https://github.com/splunk/splunk-add-on-for-microsoft-sysmon/actions/runs/29721237033/job/88285117187Fix should coerce
earliest_in_epoch/latest_in_epoch(and any otherrandintcall sites in this file) tointbefore callingrandint.Found while validating ADDON-89094's Python 3.9→3.13 bump for addonfactory-workflow-addon-release's v5.6.0 release (ADDON-88923 epic).