Commit 57ad50fb authored by Xiaowu Zhang's avatar Xiaowu Zhang

stack/erp5: Zuite_waitForActivities seems also launch activities which may create conflict

parent 2ad0d746
...@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0 ...@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template-run-zelenium] [template-run-zelenium]
filename = run-zelenium-test.py.in filename = run-zelenium-test.py.in
md5sum = 37f94ecf60876bbe30877773dfe9828b md5sum = c64f35f825200fe35328641b2b8e0fdd
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
......
...@@ -12,6 +12,7 @@ from selenium.webdriver.support.ui import WebDriverWait ...@@ -12,6 +12,7 @@ from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support import expected_conditions as EC
import time import time
from urllib import urlopen from urllib import urlopen
import json
def main(): def main():
parser = argparse.ArgumentParser(description='Run a test suite.') parser = argparse.ArgumentParser(description='Run a test suite.')
...@@ -110,20 +111,29 @@ def main(): ...@@ -110,20 +111,29 @@ def main():
"&__ac_password=%s" % (args.remote_access_url, {{ repr(user) }}, {{ repr(password) }}) "&__ac_password=%s" % (args.remote_access_url, {{ repr(user) }}, {{ repr(password) }})
# Wait until all activities are finished... # Wait until all activities are finished...
wait_url = args.remote_access_url + '/erp5/Zuite_waitForActivities' wait_url = "%s/erp5/ActivityTool_getSqlStatisticList" \
"?__ac_name=%s" \
"&__ac_password=%s" % (args.remote_access_url, {{ repr(user) }}, {{ repr(password) }})
while 1: while 1:
try: try:
response = urlopen(wait_url) response = urlopen(wait_url)
try: try:
if response.code == 500: if response.code == 500:
sys.exit(-1) sys.exit(-1)
if response.code == 200 and response.read() == 'Done.': if response.code == 200:
static_dict = json.loads(response.read())
activity_list = []
for _, value in static_dict.iteritems():
activity_list += value['line_list']
if len(activity_list) == 0:
break break
elif all(x['node'] == -2 for x in activity_list):
sys.exit(-1)
finally: finally:
response.close() response.close()
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
time.sleep(10) time.sleep(600)
tool = taskdistribution.TaskDistributor(portal_url=args.master_url) tool = taskdistribution.TaskDistributor(portal_url=args.master_url)
browser = webdriver.Remote(appium_url, capabilities) browser = webdriver.Remote(appium_url, capabilities)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment