Skip to content

Commit

Permalink
feat: fix the random seed while measuring with instruments
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed Jan 28, 2025
1 parent d137431 commit 768b5b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pytest_codspeed/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import importlib.util
import json
import os
import random
from dataclasses import dataclass, field
from pathlib import Path
from time import time
Expand Down Expand Up @@ -259,6 +260,7 @@ def _measure(
*args: P.args,
**kwargs: P.kwargs,
) -> T:
random.seed(0)
is_gc_enabled = gc.isenabled()
if is_gc_enabled:
gc.collect()
Expand Down

0 comments on commit 768b5b8

Please sign in to comment.