]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
slight changes to test scripts
authorburris <burris>
Sun, 1 Dec 2002 22:56:40 +0000 (22:56 +0000)
committerburris <burris>
Sun, 1 Dec 2002 22:56:40 +0000 (22:56 +0000)
khashmir.py

index b0b414d7cd4e0193be965a956b93559210d52448..a9bc5b55835bdbdadad3fd233c9b77de2bfc49e7 100644 (file)
@@ -290,6 +290,7 @@ def test_build_net(quiet=0, peers=24, host='localhost',  pause=0):
        from whrandom import randrange
        import threading
        import thread
+       import sys
        port = 2001
        l = []
                
@@ -305,19 +306,20 @@ def test_build_net(quiet=0, peers=24, host='localhost',  pause=0):
        time.sleep(1)
        for peer in l[1:]:
                peer.app.run()
-       time.sleep(10)
+       time.sleep(3)
        
        print "adding contacts...."
        
-       for peer in l[1:]:
+       for peer in l:
                n = l[randrange(0, len(l))].node
                peer.addContact(host, n.port)
                n = l[randrange(0, len(l))].node
                peer.addContact(host, n.port)
                n = l[randrange(0, len(l))].node
                peer.addContact(host, n.port)
-       if pause:
-               time.sleep(.33)
+               if pause:
+                       time.sleep(.33)
+               sys.stdout.flush()
        
        time.sleep(10)
        print "finding close nodes...."
@@ -328,7 +330,7 @@ def test_build_net(quiet=0, peers=24, host='localhost',  pause=0):
                        f.set()
                peer.findCloseNodes(cb)
                flag.wait()
-       
+               sys.stdout.flush()
        #    for peer in l:
        #       peer.refreshTable()
        return l