From 862b39c217426018e56e1cc2eb2f9be03ab9330b Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Thu, 22 Oct 2020 14:25:57 +0000 Subject: [PATCH] fix systemrandom shuffle --- src/communicatorutils/uploadblocks/mixmate/pool.py | 4 ++-- src/runtests/__init__.py | 3 ++- tests/runtime-result.txt | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/communicatorutils/uploadblocks/mixmate/pool.py b/src/communicatorutils/uploadblocks/mixmate/pool.py index 72c3803b..f5600082 100644 --- a/src/communicatorutils/uploadblocks/mixmate/pool.py +++ b/src/communicatorutils/uploadblocks/mixmate/pool.py @@ -63,8 +63,8 @@ class UploadPool: if len(self._pool) != self._pool_size: raise PoolNotReady - final_pool: List[onionrtypes.BlockHash] = SystemRandom().shuffle( - list(self._pool)) + final_pool: List[onionrtypes.BlockHash] = list(self._pool) + SystemRandom().shuffle(final_pool) self._pool.clear() self.birthday = onionrutils.epoch.get_epoch() diff --git a/src/runtests/__init__.py b/src/runtests/__init__.py index a2a993fe..77e26e77 100644 --- a/src/runtests/__init__.py +++ b/src/runtests/__init__.py @@ -55,7 +55,8 @@ class OnionrRunTestManager: self.run_date: int = 0 def run_tests(self): - tests = SystemRandom.shuffle(list(RUN_TESTS)) + tests = list(RUN_TESTS) + SystemRandom().shuffle(tests) cur_time = epoch.get_epoch() logger.info(f"Doing runtime tests at {cur_time}") diff --git a/tests/runtime-result.txt b/tests/runtime-result.txt index b06e92a5..703ca349 100644 --- a/tests/runtime-result.txt +++ b/tests/runtime-result.txt @@ -1 +1 @@ -1602391371 \ No newline at end of file +1603376389 \ No newline at end of file