Skip to content

Commit 7c7bc8f

Browse files
HyukjinKwonsrowen
authored andcommitted
[SPARK-21189][INFRA] Handle unknown error codes in Jenkins rather then leaving incomplete comment in PRs
## What changes were proposed in this pull request? Recently, Jenkins tests were unstable due to unknown reasons as below: ``` /home/jenkins/workspace/SparkPullRequestBuilder/dev/lint-r ; process was terminated by signal 9 test_result_code, test_result_note = run_tests(tests_timeout) File "./dev/run-tests-jenkins.py", line 140, in run_tests test_result_note = ' * This patch **fails %s**.' % failure_note_by_errcode[test_result_code] KeyError: -9 ``` ``` Traceback (most recent call last): File "./dev/run-tests-jenkins.py", line 226, in <module> main() File "./dev/run-tests-jenkins.py", line 213, in main test_result_code, test_result_note = run_tests(tests_timeout) File "./dev/run-tests-jenkins.py", line 140, in run_tests test_result_note = ' * This patch **fails %s**.' % failure_note_by_errcode[test_result_code] KeyError: -10 ``` This exception looks causing failing to update the comments in the PR. For example: ![2017-06-23 4 19 41](https://user-images.githubusercontent.com/6477701/27470626-d035ecd8-582f-11e7-883e-0ae6941659b7.png) ![2017-06-23 4 19 50](https://user-images.githubusercontent.com/6477701/27470629-d11ba782-582f-11e7-97e0-64d28cbc19aa.png) these comment just remain. This always requires, for both reviewers and the author, a overhead to click and check the logs, which I believe are not really useful. This PR proposes to leave the code in the PR comment messages and let update the comments. ## How was this patch tested? Jenkins tests below, I manually gave the error code to test this. Author: hyukjinkwon <[email protected]> Closes #18399 from HyukjinKwon/jenkins-print-errors.
1 parent bfd73a7 commit 7c7bc8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dev/run-tests-jenkins.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def run_tests(tests_timeout):
137137
if test_result_code == 0:
138138
test_result_note = ' * This patch passes all tests.'
139139
else:
140-
test_result_note = ' * This patch **fails %s**.' % failure_note_by_errcode[test_result_code]
140+
note = failure_note_by_errcode.get(
141+
test_result_code, "due to an unknown error code, %s" % test_result_code)
142+
test_result_note = ' * This patch **fails %s**.' % note
141143

142144
return [test_result_code, test_result_note]
143145

0 commit comments

Comments
 (0)