Changeset: ed8de6e8527b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ed8de6e8527b
Modified Files:
        testing/Mtest.py.in
Branch: Nov2019
Log Message:

Restart server after crash when running a single server for a directory.


diffs (42 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1342,6 +1342,10 @@ def PerformDir(env, testdir, testlist, B
                     pSrvr = ServerClass()
                     pSrvr.LaunchIt(splitcommand(env['exe']['mserver5'][1]) + 
['--dbpath=%s' % LogDBdir], open(os.devnull, 'w'), open(os.devnull, 'w'), 0, 
os.path.join(LogDBdir, '.started'), int(env['MAPIPORT']))
                 for TST,COND in testlist:
+                    if oneserver and pSrvr.poll() is not None:
+                        # restart server
+                        pSrvr = ServerClass()
+                        pSrvr.LaunchIt(splitcommand(env['exe']['mserver5'][1]) 
+ ['--dbpath=%s' % LogDBdir], open(os.devnull, 'w'), open(os.devnull, 'w'), 0, 
os.path.join(LogDBdir, '.started'), int(env['MAPIPORT']))
                     if global_timeout and start_time + global_timeout < 
time.time():
                         if not testweb:
                             print('\nGlobal testing timeout reached\n')
@@ -2290,8 +2294,16 @@ def RunTest(env, TST, BusyPorts, COND, o
 
         if pSrvr is None:
             sockerr = CheckSocket3(env, "MAPI", TestErrFile)
+        elif pSrvr.poll() is None:
+            sockerr = F_OK
         else:
-            sockerr = F_OK
+            sres = returnCode(pSrvr)
+            if sres == 'segfault':
+                sockerr = F_SEGV
+            elif sres == 'abort':
+                sockerr = F_ABRT
+            else:
+                sockerr = F_ERROR
 
         #TODO:
         ##if [ ! -f $TSTTRGBASE/Tests/.old.left-over.tmp.bats. ] ; then  touch 
$TSTTRGBASE/Tests/.old.left-over.tmp.bats. ; fi
@@ -2842,6 +2854,9 @@ class ServerClass:
         self.code = None
         self.started = False
 
+    def poll(self):
+        return self.proc.poll()
+
     def terminate(self):
         if os.name == 'nt':
             self.proc.send_signal(signal.CTRL_BREAK_EVENT)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to