Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aaron Chen
erp5
Commits
936994b3
Commit
936994b3
authored
Aug 16, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement initial timeout to never lock a test run for more them a day
parent
ea890a3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+10
-2
No files found.
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
936994b3
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
import
os
import
os
import
transaction
import
transaction
from
time
import
sleep
import
time
import
signal
import
signal
import
re
import
re
from
subprocess
import
Popen
,
PIPE
from
subprocess
import
Popen
,
PIPE
...
@@ -63,6 +63,9 @@ bt5_dir_list = ','.join([
...
@@ -63,6 +63,9 @@ bt5_dir_list = ','.join([
os.path.join(instance_home, '
Products
/
ERP5
/
bootstrap
'),
os.path.join(instance_home, '
Products
/
ERP5
/
bootstrap
'),
os.path.join(instance_home, '
bt5
')])
os.path.join(instance_home, '
bt5
')])
class TimeoutError(Exception):
pass
class Xvfb:
class Xvfb:
def __init__(self, fbdir, display):
def __init__(self, fbdir, display):
self.display = display
self.display = display
...
@@ -201,6 +204,8 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \
...
@@ -201,6 +204,8 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \
class FunctionalTestRunner:
class FunctionalTestRunner:
# There is no test that can take more them 24 hours
timeout = 24 * 60 * 60
def __init__(self, host, port, portal, run_only=''):
def __init__(self, host, port, portal, run_only=''):
...
@@ -232,12 +237,15 @@ class FunctionalTestRunner:
...
@@ -232,12 +237,15 @@ class FunctionalTestRunner:
display = None
display = None
xvfb = Xvfb(self.instance_home, None)
xvfb = Xvfb(self.instance_home, None)
try:
try:
start = time.time()
if not debug and self.browser.use_xvfb:
if not debug and self.browser.use_xvfb:
xvfb.display = self.xvfb_display
xvfb.display = self.xvfb_display
xvfb.run()
xvfb.run()
browser.run(test_url, xvfb.display)
browser.run(test_url, xvfb.display)
while self.getStatus() is None:
while self.getStatus() is None:
sleep(10)
time.sleep(10)
if (start - time.time()) > float(self.timeout):
raise TimeoutError("Test took more them %s seconds" % self.timeout)
finally:
finally:
browser.quit()
browser.quit()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment