aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-10-09 04:42:33 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-10-09 04:42:33 +0000
commit3af257824107a6a8596a5dc90a6ec97d1fc0f6e0 (patch)
treef509576f2a87712d2acc4b28b8ad7a96368ffba8
parent8c9eb761145ab8ad474a69bb3e481bb51194d974 (diff)
load each test on a random network port
svn path=/trunk/; revision=15551
-rwxr-xr-xscripts/load_every_help.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/load_every_help.py b/scripts/load_every_help.py
index 2189b51c..d08fcc93 100755
--- a/scripts/load_every_help.py
+++ b/scripts/load_every_help.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
import subprocess, sys, socket, time, os, re, time, smtplib, signal
+import random
try:
pdrootdir = sys.argv[1]
@@ -8,9 +9,6 @@ except IndexError:
print 'only one arg: root dir of pd'
sys.exit(2)
-PORT = 55555
-netreceive_patch = '/tmp/.____pd_netreceive____.pd'
-
def find_pdexe(rootdir):
# start with the Windows/Mac OS X location
exe = pdrootdir + '/bin/pd'
@@ -136,6 +134,8 @@ now = time.localtime(time.time())
date = time.strftime('20%y-%m-%d', now)
datestamp = time.strftime('20%y-%m-%d_%H.%M.%S', now)
+rand = random.SystemRandom()
+
outputfilename = 'load_every_help_' + socket.gethostname() + '_' + datestamp + '.log'
outputfile = '/tmp/' + outputfilename
fd = open(outputfile, 'w')
@@ -145,8 +145,6 @@ fd.flush()
logoutput = []
-make_netreceive_patch(netreceive_patch)
-
docdir = os.path.join(pdrootdir, 'doc')
for root, dirs, files in os.walk(docdir):
for name in files:
@@ -154,6 +152,9 @@ for root, dirs, files in os.walk(docdir):
if m:
patchoutput = []
patch = os.path.join(root, m.string)
+ PORT = int(rand.random() * 10000) + int(rand.random() * 10000) + 40000
+ netreceive_patch = '/tmp/.____pd_netreceive_'+str(PORT)+'____.pd'
+ make_netreceive_patch(netreceive_patch)
p = launch_pd()
try:
open_patch(patch)