Call randseed() before other imports in deccheck.py (GH-21834)

This commit is contained in:
Stefan Krah 2020-08-11 21:14:51 +02:00 committed by GitHub
parent 76643c10ed
commit b5f87b93a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -30,10 +30,14 @@
# #
import random
import time
RANDSEED = int(time.time())
random.seed(RANDSEED)
import sys import sys
import os import os
import time
import random
from copy import copy from copy import copy
from collections import defaultdict from collections import defaultdict
@ -1235,10 +1239,6 @@ if __name__ == '__main__':
args.single = args.single[0] args.single = args.single[0]
randseed = int(time.time())
random.seed(randseed)
# Set up the testspecs list. A testspec is simply a dictionary # Set up the testspecs list. A testspec is simply a dictionary
# that determines the amount of different contexts that 'test_method' # that determines the amount of different contexts that 'test_method'
# will generate. # will generate.
@ -1306,9 +1306,9 @@ if __name__ == '__main__':
if args.multicore: if args.multicore:
q = Queue() q = Queue()
elif args.single: elif args.single:
log("Random seed: %d", randseed) log("Random seed: %d", RANDSEED)
else: else:
log("\n\nRandom seed: %d\n\n", randseed) log("\n\nRandom seed: %d\n\n", RANDSEED)
FOUND_METHOD = False FOUND_METHOD = False