Skip to content

Commit

Permalink
teuthology/suite: initialize lua prng using run's seed
Browse files Browse the repository at this point in the history
When a script may use Lua's prng, we want it to produce the same sequence
during a rerun.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
  • Loading branch information
batrick committed Mar 19, 2024
1 parent e691533 commit 70875af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions teuthology/suite/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def config_merge(configs, suite_name=None, **kwargs):
the entire job (config) from the list.
"""

seed = kwargs.get('seed')
new_script = L.eval(f'local math = require"math"; math.randomseed({seed});')
new_script = L.eval('new_script')
yaml_cache = {}
for desc, paths in configs:
Expand Down
1 change: 1 addition & 0 deletions teuthology/suite/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ def schedule_suite(self):
filter_out=self.args.filter_out,
filter_all=self.args.filter_all,
filter_fragments=self.args.filter_fragments,
seed=self.args.seed,
suite_name=suite_name))

if self.args.dry_run:
Expand Down

0 comments on commit 70875af

Please sign in to comment.