Use the version number in the Khashmir node ID.
[quix0rs-apt-p2p.git] / apt_p2p_Khashmir / DHT.py
index cc3660c5679149e78e68447cacb3ab3f13418234..dbaf6836ec327c249fb2301c822efa7268f1ea90 100644 (file)
@@ -332,12 +332,12 @@ class TestSimpleDHT(unittest.TestCase):
     """Simple 2-node unit tests for the DHT."""
     
     timeout = 50
-    DHT_DEFAULTS = {'PORT': 9977,
-                    'CHECKPOINT_INTERVAL': 300, 'CONCURRENT_REQS': 4,
-                    'STORE_REDUNDANCY': 3, 'RETRIEVE_VALUES': -10000,
+    DHT_DEFAULTS = {'VERSION': 'A000', 'PORT': 9977,
+                    'CHECKPOINT_INTERVAL': 300, 'CONCURRENT_REQS': 8,
+                    'STORE_REDUNDANCY': 6, 'RETRIEVE_VALUES': -10000,
                     'MAX_FAILURES': 3, 'LOCAL_OK': True,
                     'MIN_PING_INTERVAL': 900,'BUCKET_STALENESS': 3600,
-                    'KRPC_TIMEOUT': 14, 'KRPC_INITIAL_DELAY': 2,
+                    'KRPC_TIMEOUT': 9, 'KRPC_INITIAL_DELAY': 2,
                     'KEY_EXPIRE': 3600, 'SPEW': True, }
 
     def setUp(self):
@@ -451,14 +451,14 @@ class TestSimpleDHT(unittest.TestCase):
 class TestMultiDHT(unittest.TestCase):
     """More complicated 20-node tests for the DHT."""
     
-    timeout = 100
+    timeout = 200
     num = 20
-    DHT_DEFAULTS = {'PORT': 9977,
-                    'CHECKPOINT_INTERVAL': 300, 'CONCURRENT_REQS': 4,
-                    'STORE_REDUNDANCY': 3, 'RETRIEVE_VALUES': -10000,
+    DHT_DEFAULTS = {'VERSION': 'A000', 'PORT': 9977,
+                    'CHECKPOINT_INTERVAL': 300, 'CONCURRENT_REQS': 8,
+                    'STORE_REDUNDANCY': 6, 'RETRIEVE_VALUES': -10000,
                     'MAX_FAILURES': 3, 'LOCAL_OK': True,
                     'MIN_PING_INTERVAL': 900,'BUCKET_STALENESS': 3600,
-                    'KRPC_TIMEOUT': 14, 'KRPC_INITIAL_DELAY': 2,
+                    'KRPC_TIMEOUT': 9, 'KRPC_INITIAL_DELAY': 2,
                     'KEY_EXPIRE': 3600, 'SPEW': True, }
 
     def setUp(self):
@@ -477,7 +477,7 @@ class TestMultiDHT(unittest.TestCase):
         if next_node + 1 < len(self.l):
             d.addCallback(self.node_join, next_node + 1)
         else:
-            d.addCallback(self.lastDefer.callback)
+            reactor.callLater(1, d.addCallback, self.lastDefer.callback)
     
     def test_join(self):
         self.timeout = 2