From 3b636396a5d558126f9d18ff89b3e4d5bae06079 Mon Sep 17 00:00:00 2001 From: burris Date: Sun, 1 Dec 2002 22:56:40 +0000 Subject: [PATCH] slight changes to test scripts --- khashmir.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/khashmir.py b/khashmir.py index b0b414d..a9bc5b5 100644 --- a/khashmir.py +++ b/khashmir.py @@ -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 -- 2.39.5