diff --git a/resources/scenarios/miner_std.py b/resources/scenarios/miner_std.py index 3fa06c7d3..1eb5e14b8 100755 --- a/resources/scenarios/miner_std.py +++ b/resources/scenarios/miner_std.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +from random import randint from time import sleep from commander import Commander @@ -35,6 +36,12 @@ def add_options(self, parser): type=int, help="Number of seconds between block generation (default 60 seconds)", ) + parser.add_argument( + "--random-interval", + dest="random_interval", + action="store_true", + help="Should the interval be randomized between 0 and the interval value", + ) parser.add_argument( "--mature", dest="mature", @@ -71,7 +78,10 @@ def run_test(self): ) except Exception as e: self.log.error(f"node {miner.node.index} error: {e}") - sleep(self.options.interval) + if self.options.random_interval: + sleep(randint(0, self.options.interval)) + else: + sleep(self.options.interval) def main():