From f3718da14cedc5d55a2e250abcf181f80415453e Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Tue, 26 Jul 2011 15:17:35 -0700 Subject: [PATCH] Let config file control random number generator seeds in detail. --- s3tests/readwrite.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/s3tests/readwrite.py b/s3tests/readwrite.py index f0122c8..a06210b 100644 --- a/s3tests/readwrite.py +++ b/s3tests/readwrite.py @@ -16,9 +16,9 @@ import common NANOSECOND = int(1e9) -def reader(bucket, worker_id, file_names, queue): +def reader(bucket, worker_id, file_names, queue, rand): while True: - objname = random.choice(file_names) + objname = rand.choice(file_names) key = bucket.new_key(objname) fp = realistic.FileVerifier() @@ -64,10 +64,10 @@ def reader(bucket, worker_id, file_names, queue): ) queue.put(result) -def writer(bucket, worker_id, file_names, files, queue): +def writer(bucket, worker_id, file_names, files, queue, rand): while True: fp = next(files) - objname = random.choice(file_names) + objname = rand.choice(file_names) key = bucket.new_key(objname) result = dict( @@ -109,8 +109,6 @@ def parse_options(): parser = optparse.OptionParser( usage='%prog [OPTS]