Changeset: 1e640a76f3c0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1e640a76f3c0
Modified Files:
testing/Mtest.py.in
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:
Merged from Aug2011
diffs (truncated from 641 to 300 lines):
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -209,9 +209,8 @@ F_WARN = 1
F_SOCK = 2
F_TIME = 3
F_RECU = 4
-F_KILL = 5
-F_SEGV = 6
-F_ERROR = 7
+F_SEGV = 5
+F_ERROR = 6
FAILURES = {
F_SKIP : "F_SKIP",
@@ -220,7 +219,6 @@ FAILURES = {
F_SOCK : "F_SOCK",
F_TIME : "F_TIME",
F_RECU : "F_RECU",
- F_KILL : "F_KILL",
F_SEGV : "F_SEGV",
F_ERROR : "F_ERROR"
}
@@ -419,7 +417,8 @@ class Comment:
f.write(str(self))
class Timer:
- # interface to the threading.Timer function that interprets a timeout of 0
as no timeout
+ # interface to the threading.Timer function that interprets a
+ # timeout of 0 as no timeout
def __init__(self, interval, function, args):
self.timer = None
if interval > 0:
@@ -448,7 +447,6 @@ purple = '#aa00aa'
stylesheet = Element('style', None, Text('''
.error { font-weight: bold; font-style: italic; color: red; }
.segfault { font-weight: bold; font-style: italic; color: purple; }
-.killed { font-weight: bold; font-style: italic; color: purple; }
.recursion { font-weight: bold; font-style: italic; color: purple; }
.timeout { font-weight: bold; font-style: italic; color: purple; }
.socket { font-weight: bold; font-style: italic; color: purple; }
@@ -655,7 +653,7 @@ def CreateTstWhatXhtml (env, TST, stable
f.close()
diffclass = 'error'
difftext = 'Major differences'
- if diffclass == 'error' and SockTime in (F_SOCK, F_TIME, F_RECU, F_KILL,
F_SEGV):
+ if diffclass == 'error' and SockTime in (F_SOCK, F_TIME, F_RECU, F_SEGV):
if SockTime == F_SOCK:
diffclass = 'socket'
difftext = difftext + ' (Socket)'
@@ -665,9 +663,6 @@ def CreateTstWhatXhtml (env, TST, stable
if SockTime == F_RECU:
diffclass = 'recursion'
difftext = difftext + ' (Recursion)'
- if SockTime == F_KILL:
- diffclass = 'killed'
- difftext = difftext + ' (Killed)'
if SockTime == F_SEGV:
diffclass = 'segfault'
difftext = difftext + ' (Crash)'
@@ -868,8 +863,6 @@ def CreateSrcIndex (env, TST, EXT) :
def AddHref (href, target, linktext, diff) :
if diff == F_ERROR:
klass = 'error'
- elif diff == F_KILL:
- klass = 'killed'
elif diff == F_RECU:
klass = 'recursion'
elif diff == F_TIME:
@@ -924,12 +917,10 @@ def AddTstToHtmlIndex (env, TST, STABLEo
ff.write("\n<!--MajorDiffs-->\n")
ff.close()
e = F_ERROR
- if e == F_ERROR and SockTime in (F_SOCK, F_TIME, F_RECU, F_KILL, F_SEGV):
+ if e == F_ERROR and SockTime in (F_SOCK, F_TIME, F_RECU, F_SEGV):
e = SockTime
if o == F_ERROR or e == F_ERROR:
tstclass = 'error'
- elif e == F_KILL:
- tstclass = 'killed'
elif e == F_RECU:
tstclass = 'recursion'
elif e == F_TIME:
@@ -1330,8 +1321,7 @@ def GetBitsAndOIDsAndModsAndStaticAndThr
t = Timer(float(par['TIMEOUT']), killProc, args = [proc, proc.stderr, cmd])
try:
t.start()
- if par['M5']:
- input = '''\
+ input = '''\
c := mdb.modules();
mods := algebra.kunique(c);
s := "\\nModules: ";
@@ -1428,8 +1418,7 @@ def CheckMods(env, TST, SERVER, CALL) :
if m and m[0] != "#" and m not in env['TST_MODS']:
missing.append(m)
if SERVER == "SQL":
- if par['M5']:
- sql_mods = ["sql"]
+ sql_mods = ["sql"]
for m in sql_mods:
if m not in env['TST_MODS']:
missing.append(m)
@@ -1451,30 +1440,6 @@ def CheckTests(env, TST, oktests):
return missing
### CheckTests(env, TST, oktests) #
-def StartAt(cmd) :
- if procdebug:
- print 'StartAt: starting process "%s" (inpipe, outpipe, errpipe)\n' %
cmd
- proc = subprocess.Popen(cmd, shell = True, stdin = subprocess.PIPE, stdout
= subprocess.PIPE, stderr = subprocess.PIPE, universal_newlines = True)
- qOut, qErr = proc.communicate()
- if procdebug:
- print 'StartAt: starting exited "%s"\n' % cmd
- return qOut.split('\n', 1)[0].strip()
-### StartAt(cmd) #
-
-def StopAt(ATJOB,ME) :
- while os.path.isfile(path("/tmp/.MkillUsers."+ME)):
- time.sleep(9)
- if SYST in ("IRIX", "IRIX64", "Darwin", "HPUX") or SYSTVER[:-1] ==
"SunOS5.1":
- ATRM = 'at -r '
- elif SYST == "SunOS":
- ATRM = 'atrm -f '
- else:
- ATRM = 'atrm '
- os.system(ATRM+ATJOB)
- #TODO:
- #LOG1x at -l >&2
-### StopAt(ATJOB,ME) #
-
def StableOutErr(env,par,TST,SYST,RELEASE,DIST,VERSION) :
BITS = env['TST_BITS']
OIDS = env['TST_OIDS']
@@ -1681,7 +1646,7 @@ def RunTest(env, TST, BusyPorts, COND, o
PRELUDE = []
if EXT != '.sql':
- if os.path.isfile(TST+".prelude5") and par['M5']:
+ if os.path.isfile(TST+".prelude5"):
PRELUDE = [TST+".prelude5"]
TIMEOUT = par['TIMEOUT']
@@ -1715,31 +1680,6 @@ def RunTest(env, TST, BusyPorts, COND, o
STIMEOUT = STIMEOUT + TIMEOUT + min(TIMEOUT, par['TIMEOUT'])
ME = ""
- ATJOB1 = ""
- MkillUsers = ""
- MkillUsersAT = ""
- if TIMEOUT and os.name != "nt" and sys.platform != 'cygwin' and
env.get('USE_AT'):
- for f in TST+".KILLED.out", TST+".KILLED.err":
- if os.path.isfile(f):
- os.remove(f)
- ME = str(os.getpid())
- WAIT = str(int(STIMEOUT / 60) + 2)
- FILES = os.path.join(TSTTRGDIR,TST)+"
"+os.path.join(TSTTRGDIR,TST)+".*"
- for f in ["bat/\\*", '.gdk_lock']:
- FILES = FILES+" "+os.path.join(env['GDK_DBFARM'],TSTDB,path(f))
- WHAT0 = os.path.join(THISPATH,"MkillUsers")
- if env.get('CONCURRENT'):
- WHAT0 = WHAT0+" --concurrent"
- WHAT0 = WHAT0+" -l"+ME
- WHAT1 = FILES+r"
\>\>"+os.path.join(TSTTRGDIR,TST+".KILLED.out")+r"
2\>\>"+os.path.join(TSTTRGDIR,TST+".KILLED.err")
- WHAT = WHAT0+" -p"+ME+" "+WHAT1
- WHEN = "now + "+WAIT+" minutes"
- cmd = "echo "+WHAT+" 2>/dev/null | at "+WHEN+" 2>&1 | awk
'/^[Jj]ob/{print $2}'"
- ATJOB1 = StartAt(cmd)
- #TODO:
- #LOG1x at -l >&2
- MkillUsers = (WHAT0+" "+WHAT1).replace('\\','')
- MkillUsersAT = "echo "+WHAT+" 2>/dev/null | at now + 1 minute
2>&1 | awk '/^[Jj]ob/{print $2}'"
TestOutFile = TST+".test.out"
TestErrFile = TST+".test.err"
@@ -1751,7 +1691,7 @@ def RunTest(env, TST, BusyPorts, COND, o
TestErr.close()
t0 = time.time()
- tres = DoIt(env, SERVER, CALL, TST, EXT, PRELUDE, TestOutFile,
TestErrFile, STIMEOUT, CTIMEOUT, TIMEOUT, MkillUsersAT, ME, MAPIsockets, length)
+ tres = DoIt(env, SERVER, CALL, TST, EXT, PRELUDE, TestOutFile,
TestErrFile, STIMEOUT, CTIMEOUT, TIMEOUT, ME, MAPIsockets, length)
t1 = time.time()
TX = t1 - t0
@@ -1760,7 +1700,6 @@ def RunTest(env, TST, BusyPorts, COND, o
timeout = F_OK
recursion = F_OK
- killed = F_OK
segfaulted = F_OK
if tres == 'timeout':
@@ -1770,33 +1709,6 @@ def RunTest(env, TST, BusyPorts, COND, o
elif tres == 'segfault':
segfaulted = F_SEGV
- if ATJOB1:
- StopAt(ATJOB1,ME)
- os.system(WHAT.replace('\\', '').replace(" -p"+ME+" ", ' '))
- else:
- while os.path.exists(os.path.join(TSTTRGBASE,".KILLED.lck")):
- time.sleep(1)
-
- if MkillUsers:
- os.system(MkillUsers)
-
- n = TST+".KILLED."
- for (x,txf) in [("out",TestOutFile),("err",TestErrFile)]:
- f = n+x
- if os.name == "nt":
- for t in os.path.join(TSTTRGBASE,f),
os.path.join(TSTTRGBASE,".KILLED."+x):
- if os.path.isfile(t):
- shutil.copy(t,f)
- os.remove(t)
- break
- if os.path.isfile(f) and os.path.getsize(f):
- p = try_open(txf, 'a')
- if p is not None:
- for l in open(f):
- p.write("! "+l)
- killed = F_KILL
- p.close()
-
sockerr = F_OK
sockerr = max(sockerr, CheckSocket3(env, "MAPI", TestErrFile))
@@ -1827,12 +1739,6 @@ def RunTest(env, TST, BusyPorts, COND, o
elif verbose:
STDOUT.write("(Recursion!) ")
- if killed == F_KILL:
- if quiet:
- STDOUT.write("\n%s : Killed!\n" % TST)
- elif verbose:
- STDOUT.write("(Killed!) ")
-
if segfaulted == F_SEGV:
if quiet:
STDOUT.write("\n%s : Crashed!\n" % TST)
@@ -1869,8 +1775,8 @@ def RunTest(env, TST, BusyPorts, COND, o
diff_html.write('<!--MajorDiffs-->\n')
diff_html.close()
timedout = True
- if timeout == F_TIME or recursion == F_RECU or killed == F_KILL or
segfaulted == F_SEGV:
- # test run timed out or orphan processes were killed => expect
major differences!
+ if timeout == F_TIME or recursion == F_RECU or segfaulted == F_SEGV:
+ # test run timed out or crashed => expect major differences!
ACCURACYout = -1
else:
fs = open("%s%s.FILTERED" % (TST, STABLEout))
@@ -1939,8 +1845,8 @@ def RunTest(env, TST, BusyPorts, COND, o
diff_html.write('<!--MajorDiffs-->\n')
diff_html.close()
timedout = True
- if timeout == F_TIME or recursion == F_RECU or killed == F_KILL or
segfaulted == F_SEGV:
- # test run timed out or orphan processes were killed => expect
major differences!
+ if timeout == F_TIME or recursion == F_RECU or segfaulted == F_SEGV:
+ # test run timed out or crashed => expect major differences!
ACCURACYerr = -1
else:
fs = open("%s%s.FILTERED" % (TST, STABLEerr))
@@ -2004,15 +1910,13 @@ def RunTest(env, TST, BusyPorts, COND, o
proc = subprocess.Popen(cmd)
proc.wait()
- FailedOut, FailedErr, elem = AddTstToHtmlIndex(env, TST, STABLEout,
STABLEerr, EXT, max(sockerr, timeout, recursion, killed, segfaulted))
+ FailedOut, FailedErr, elem = AddTstToHtmlIndex(env, TST, STABLEout,
STABLEerr, EXT, max(sockerr, timeout, recursion, segfaulted))
if not verbose and not quiet:
if timeout == F_TIME:
STDOUT.write("TIMEOUT")
elif recursion == F_RECU:
STDOUT.write("RECURSION")
- elif killed == F_KILL:
- STDOUT.write("KILLED")
elif segfaulted == F_SEGV:
STDOUT.write("CRASHED")
else:
@@ -2267,7 +2171,7 @@ def mapi_ping(port,lang) :
return False
### mapi_ping() #
-def DoIt(env, SERVER, CALL, TST, EXT, PRELUDE, TestOutFile, TestErrFile,
STIMEOUT, CTIMEOUT, TIMEOUT, MkillUsersAT, ME, MAPIsockets, length) :
+def DoIt(env, SERVER, CALL, TST, EXT, PRELUDE, TestOutFile, TestErrFile,
STIMEOUT, CTIMEOUT, TIMEOUT, ME, MAPIsockets, length) :
ATJOB2 = ""
STDERR.flush()
if quiet:
@@ -2296,9 +2200,6 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
else:
LOCAL_CONF = []
- if par['M5']:
- PRINTF = "io.printf"
-
# Release reserved sockets and run the actual test
MAPIsockets[0].close()
MAPIsockets[1].close()
@@ -2319,13 +2220,12 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
ClntErr = open(ClntErrFile,"w")
PROLOGUE = []
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list