Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
36ed7f8a
Commit
36ed7f8a
authored
Jan 19, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to make the test result passing from forked tests more robust.
See #2807.
parent
0a962c22
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
runtests.py
runtests.py
+15
-16
No files found.
runtests.py
View file @
36ed7f8a
...
@@ -1310,7 +1310,6 @@ def run_forked_test(result, run_func, test_name, fork=True):
...
@@ -1310,7 +1310,6 @@ def run_forked_test(result, run_func, test_name, fork=True):
child_id = os.fork()
child_id = os.fork()
if not child_id:
if not child_id:
result_code = 0
result_code = 0
output = None
try:
try:
try:
try:
tests = partial_result = None
tests = partial_result = None
...
@@ -1330,7 +1329,8 @@ def run_forked_test(result, run_func, test_name, fork=True):
...
@@ -1330,7 +1329,8 @@ def run_forked_test(result, run_func, test_name, fork=True):
_shortDescription=test_name,
_shortDescription=test_name,
module_name=None)
module_name=None)
partial_result.addError(tests, sys.exc_info())
partial_result.addError(tests, sys.exc_info())
output = open(result_file, 'wb')
if partial_result is not None:
with open(result_file, 'wb') as output:
pickle.dump(partial_result.data(), output)
pickle.dump(partial_result.data(), output)
except:
except:
traceback.print_exc()
traceback.print_exc()
...
@@ -1339,11 +1339,6 @@ def run_forked_test(result, run_func, test_name, fork=True):
...
@@ -1339,11 +1339,6 @@ def run_forked_test(result, run_func, test_name, fork=True):
except: pass
except: pass
try: sys.stdout.flush()
try: sys.stdout.flush()
except: pass
except: pass
try:
if output is not None:
output.close()
except:
pass
os._exit(result_code)
os._exit(result_code)
try:
try:
...
@@ -1353,18 +1348,22 @@ def run_forked_test(result, run_func, test_name, fork=True):
...
@@ -1353,18 +1348,22 @@ def run_forked_test(result, run_func, test_name, fork=True):
# upper byte of result_code, and the signal it was
# upper byte of result_code, and the signal it was
# killed by in the lower byte
# killed by in the lower byte
if result_code & 255:
if result_code & 255:
raise Exception("Tests in module '%s' were unexpectedly killed by signal %d"%
raise Exception(
(module_name, result_code & 255))
"Tests in module '%s' were unexpectedly killed by signal %d, see test output for details." % (
module_name, result_code & 255))
result_code >>= 8
result_code >>= 8
if result_code in (0,1):
if result_code in (0,1):
input = open(result_file, 'rb')
try:
try:
PartialTestResult.join_results(result, pickle.load(input))
with open(result_file, 'rb') as f:
finally:
PartialTestResult.join_results(result, pickle.load(f))
input.close()
except Exception:
raise Exception(
"Failed to load test result from test in module '%s' after exit status %d,"
" see test output for details." % (module_name, result_code))
if result_code:
if result_code:
raise Exception("Tests in module '%s' exited with status %d" %
raise Exception(
(module_name, result_code))
"Tests in module '%s' exited with status %d, see test output for details." % (
module_name, result_code))
finally:
finally:
try:
try:
os.unlink(result_file)
os.unlink(result_file)
...
...
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