Changeset: 49237ee44c62 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=49237ee44c62
Modified Files:
testing/Mtest.py.in
Branch: Jul2015
Log Message:
Implemented a --global_timeout (or -T) option to set timeout for Mtest.py run.
This option doesn't kill a test, it just refrains from starting more
tests.
diffs (58 lines):
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -40,6 +40,9 @@ quiet = False
releaserun = False
+global_timeout = 0
+start_time = time.time()
+
# whether output goes to a tty
isatty = os.isatty(sys.stdout.fileno())
@@ -1223,6 +1226,8 @@ def PerformDir(env, testdir, testlist, B
body_bad.append(bodyline)
if FtOut == F_OK and FtErr == F_OK:
oktests.append(TST)
+ if global_timeout and start_time + global_timeout < time.time():
+ break
TIMES.append((TSTDIR, '', "%7.3f" % td, td, FdOut, FdErr, None))
if testweb:
os.chdir(TSTTRGDIR)
@@ -3528,6 +3533,8 @@ def main(argv) :
'special handling for Jenkins'),
('addreqs', None, 'addreqs', None,
'automatically add required tests when testing individual tests'),
+ ('global_timeout', 'T', 'global_timeout', '<sec>',
+ 'global timeout'),
]
if THISFILE == 'Mtest.py':
@@ -3609,6 +3616,7 @@ def main(argv) :
CONDITIONALS['RELEASERUN'] = releaserun
jenkins = False
addreqs = False
+ global global_timeout
if THISFILE == "Mtest.py":
_IGNORE = dftIGNORE
par['IGNORE'] = opts.get('ignore', _IGNORE)
@@ -3652,6 +3660,9 @@ def main(argv) :
env['MULTIFARM'] = 'True'
jenkins = opts.get('jenkins', False)
addreqs = opts.get('addreqs', False)
+ a = opts.get('global_timeout')
+ if a is not None:
+ global_timeout = int(a)
if THISFILE == 'Mapprove.py':
a = opts.get('ext')
if a is None:
@@ -4143,6 +4154,8 @@ def main(argv) :
body_good.append(elem)
else:
body_bad.append(elem)
+ if global_timeout and start_time + global_timeout <
time.time():
+ break
body = body_bad + body_good
if THISFILE == "Mtest.py":
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list