diff --git a/test/mp_sync_test.py b/test/mp_sync_test.py index 6f6d88b..e682ff9 100644 --- a/test/mp_sync_test.py +++ b/test/mp_sync_test.py @@ -22,6 +22,8 @@ scenario0 = [ ("A", [mp.create_account, ["some.one@some.where", "Some One"]]), ("B", [mp.create_account, ["some.one@some.where", "Some One"]]), ("A", [None, None]), + ("B", [None, None]), + ("A", [None, None]), ("B", [None, None]) ] diff --git a/test/multipEp.py b/test/multipEp.py index 4bc6d40..fbf4e87 100644 --- a/test/multipEp.py +++ b/test/multipEp.py @@ -1,7 +1,9 @@ import os +import sys import multiprocessing import importlib import tempfile +import time from collections import OrderedDict # per-instance globals @@ -133,12 +135,30 @@ def run_scenario(scenario): args=(iname,child_conn,msgs_folders)) proc.start() instances[iname] = (proc, conn) + if "wait_for_debug" in sys.argv: + yes = input("#"*80 + "\n" + + "INSTANCE " + iname + "\n" + + "Enter y/yes/Y/YES to attach debugger to process " + + str(proc.pid) + "\nor just press ENTER\n" + + "#"*80 + "\n") + if yes in ["y", "Y", "yes" "YES"]: + # TODO : linux terminal support + #import subprocess + #subprocess.call(['xterm', '-e', 'lldb', '-p', str(proc.pid)]) + import appscript + appscript.app('Terminal').do_script('lldb -p ' + str(proc.pid)) + time.sleep(2) else: proc, conn = instances[iname] conn.send(order) res = conn.recv() + if "wait_for_debug" in sys.argv: + input("#"*80 + "\n" + + "Press ENTER to cleanup\n" + + "#"*80 + "\n") + for iname, (proc, conn) in instances.items(): # tell process to terminate conn.send(None)