Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teuthology/suite: initialize lua prng using run's seed #1926

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions teuthology/describe_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def output_summary(path, limit=0,
filter_in=filter_in,
filter_out=filter_out,
filter_all=filter_all,
filter_fragments=filter_fragments)
filter_fragments=filter_fragments,
seed=seed)
for c in configs:
if limit and count >= limit:
break
Expand Down Expand Up @@ -185,7 +186,8 @@ def get_combinations(suite_dir,
filter_in=filter_in,
filter_out=filter_out,
filter_all=filter_all,
filter_fragments=filter_fragments)
filter_fragments=filter_fragments,
seed=seed)
for _, fragment_paths, __ in configs:
if limit > 0 and num_listed >= limit:
break
Expand Down
6 changes: 6 additions & 0 deletions teuthology/suite/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ def config_merge(configs, suite_name=None, **kwargs):
the entire job (config) from the list.
"""

seed = kwargs.setdefault('seed', 1)
if not isinstance(seed, int):
log.debug("no valid seed input: using 1")
seed = 1
log.debug("configuring Lua randomseed to %d", seed)
L.execute(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