Skip to content

Commit 768b5b8

Browse files
committed
feat: fix the random seed while measuring with instruments
1 parent d137431 commit 768b5b8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pytest_codspeed/plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import importlib.util
66
import json
77
import os
8+
import random
89
from dataclasses import dataclass, field
910
from pathlib import Path
1011
from time import time
@@ -259,6 +260,7 @@ def _measure(
259260
*args: P.args,
260261
**kwargs: P.kwargs,
261262
) -> T:
263+
random.seed(0)
262264
is_gc_enabled = gc.isenabled()
263265
if is_gc_enabled:
264266
gc.collect()

0 commit comments

Comments
 (0)