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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard
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
Hide 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 @@
import
os
import
transaction
from
time
import
sleep
import
time
import
signal
import
re
from
subprocess
import
Popen
,
PIPE
...
...
@@ -63,6 +63,9 @@ bt5_dir_list = ','.join([
os.path.join(instance_home, '
Products
/
ERP5
/
bootstrap
'),
os.path.join(instance_home, '
bt5
')])
class TimeoutError(Exception):
pass
class Xvfb:
def __init__(self, fbdir, display):
self.display = display
...
...
@@ -201,6 +204,8 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \
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=''):
...
...
@@ -232,12 +237,15 @@ class FunctionalTestRunner:
display = None
xvfb = Xvfb(self.instance_home, None)
try:
start = time.time()
if not debug and self.browser.use_xvfb:
xvfb.display = self.xvfb_display
xvfb.run()
browser.run(test_url, xvfb.display)
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:
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