X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=blobdiff_plain;f=apt_p2p_Khashmir%2FDHT.py;h=dbaf6836ec327c249fb2301c822efa7268f1ea90;hp=af247302f9ed6dc0b3838bbef09d2ebf681d54f8;hb=c14ca771c67c88699e7b4eb065d834976e4711ba;hpb=17b7fb5f34a147cf61191d857a4735ec9e331842 diff --git a/apt_p2p_Khashmir/DHT.py b/apt_p2p_Khashmir/DHT.py index af24730..dbaf683 100644 --- a/apt_p2p_Khashmir/DHT.py +++ b/apt_p2p_Khashmir/DHT.py @@ -332,9 +332,9 @@ 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': 9, 'KRPC_INITIAL_DELAY': 2, @@ -451,11 +451,11 @@ 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': 9, 'KRPC_INITIAL_DELAY': 2, @@ -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