Changeset: 1953b648342d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1953b648342d
Modified Files:
testing/Mtest.py.in
Branch: default
Log Message:
Start server that is used to get architecture info in daemon mode.
diffs (80 lines):
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1712,7 +1712,13 @@ def GetBitsAndModsAndThreads(env) :
global setpgrp
rtrn = 0
cmd = splitcommand(env['exe']['mserver5'][1])
- cmd.append('--dbpath=%s' % os.path.join(env['GDK_DBFARM'], TSTPREF))
+ dbpath = os.path.join(env['GDK_DBFARM'], TSTPREF)
+ try:
+ os.unlink(os.path.join(dbpath, '.started'))
+ except OSError:
+ pass
+ cmd.append('--dbpath=%s' % dbpath)
+ cmd.extend(['--set', 'monet_daemon=yes'])
if env.get('MULTIFARM'):
cmd.append('--dbextra=%s' % os.path.join(env['GDK_DBFARM'], TSTPREF +
'_transient'))
shutil.rmtree(os.path.join(env['GDK_DBFARM'], TSTPREF + '_transient'),
@@ -1728,7 +1734,20 @@ def GetBitsAndModsAndThreads(env) :
t = Timer(float(par['TIMEOUT']), killProc, args = [proc, proc.stderr, cmd])
try:
t.start()
- input = '''\
+ while True:
+ proc.poll()
+ if proc.returncode is not None:
+ break
+ if os.path.exists(os.path.join(dbpath, '.started')):
+ break
+ time.sleep(0.001)
+ if proc.returncode is None:
+ cmd = splitcommand(env['exe']['MAL_Client'][1])
+ if procdebug:
+ print('GetBitsAndModsAndThreads: starting process "%s"
(inpipe, outpipe, errpipe)\n' % '" "'.join(cmd))
+ clnt = process.Popen(cmd, stdin=process.PIPE, stdout=process.PIPE,
+ stderr=process.PIPE, universal_newlines=True)
+ input = '''\
c := mdb.modules();
modsid := algebra.unique(c);
mods := algebra.projection(modsid,c);
@@ -1744,10 +1763,15 @@ def GetBitsAndModsAndThreads(env) :
exit h;
s := s + "\\n";
io.printf(s);
- clients.quit();
'''
- ##module("NoModule");
- qOut, qErr = proc.communicate(input = input)
+ ##module("NoModule");
+ qOut, qErr = clnt.communicate(input=input)
+ proc.terminate()
+ sOut = proc.stdout.read()
+ sErr = proc.stderr.read()
+ proc.wait()
+ qOut = sOut + qOut
+ qErr = sErr + qErr
t.cancel()
if procdebug:
print('GetBitsAndModsAndThreads: process exited "%s" (%s)\n' % ('"
"'.join(cmd), proc.returncode))
@@ -1757,20 +1781,6 @@ def GetBitsAndModsAndThreads(env) :
if procdebug:
print('GetBitsAndModsAndThreads: process killed "%s"\n' % '"
"'.join(cmd))
raise
- returncode = returnCode(proc)
- if returncode is not None:
- STDERR.write(' '.join(cmd) + "\n\n")
- if input:
- STDERR.write(input)
- STDERR.write("\n")
- if qOut:
- STDERR.write(qOut)
- STDERR.write("\n")
- if qErr:
- STDERR.write(qErr)
- STDERR.write("\n")
- STDERR.flush()
- ErrExit('GetBitsAndModsAndThreads: subcommand failed: %s' % returncode)
env['TST_MODS'] = []
env['TST_BITS'] = ""
env['TST_INT128'] = ""
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list