[tor-commits] [stem/master] Performing integ test queries in parallel

atagar at torproject.org atagar at torproject.org
Mon Jul 22 03:10:17 UTC 2013


commit d87f35c7c0f99d52a530cdf12d03ef6abd9cadb0
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Jul 14 14:06:12 2013 -0700

    Performing integ test queries in parallel
    
    What good is designing an asynchronous descriptor fetching API if you poll
    things serially? Trivial tweak to reduce this test's runtime from 2.4s to
    0.4s.
---
 test/integ/descriptor/remote.py |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/integ/descriptor/remote.py b/test/integ/descriptor/remote.py
index 7ac6757..50d6d28 100644
--- a/test/integ/descriptor/remote.py
+++ b/test/integ/descriptor/remote.py
@@ -25,15 +25,18 @@ class TestDescriptorReader(unittest.TestCase):
     if test.runner.require_online(self):
       return
 
+    queries = []
+
     for authority, (address, dirport) in stem.descriptor.remote.DIRECTORY_AUTHORITIES.items():
-      query = stem.descriptor.remote.Query(
+      queries.append(stem.descriptor.remote.Query(
         address,
         dirport,
         '/tor/server/fp/9695DFC35FFEB861329B9F1AB04C46397020CE31',
         'server-descriptor 1.0',
         30,
-      )
+      ))
 
+    for query in queries:
       try:
         descriptors = list(query.run())
       except Exception, exc:





More information about the tor-commits mailing list