KAFKA-17479 Fail the whole pipeline if junit step times out [4/n]#17121
Conversation
173da2f to
042b94c
Compare
042b94c to
380192c
Compare
|
I have tested the timeout case on mumrah/kafka here https://github.com/mumrah/kafka/actions/runs/10745303070/job/29804106047?pr=13#step:6:71 This is a perfect example since we do actually see some test reports being processed The timeout error is coalesced into the Parse JUnit Tests step:
And, most importantly, the link from the PR takes us to the JUnit summary instead of the actual Test step. This is important because the Test step usually has 10s of thousands of log lines and often gets truncated in the UI. Linking to the summary step is much more user friendly. Screen.Recording.2024-09-06.at.5.32.07.PM.mp4 |
|
|
||
| parser.add_argument("--done-file", | ||
| required=False, | ||
| default="", |
There was a problem hiding this comment.
out of curiosity, why not set default value like build/junit-xml/done?
There was a problem hiding this comment.
I wanted this to be an optional argument so its easier to test locally. I don't feel too strongly about this, either way seems fine
There was a problem hiding this comment.
The "--path" has default value, so that is why I raise this comment 😃
For another trivial reason, we can simplify the command passed to junit parser if it has default value.
|
Adding a finalizer to the default "test" task did not work as expected. I can't find a simple way to add task to run after all the subproject ":test" tasks, so I changed this to have the GH workflow explicitly call createDoneFile |
Could we check the create time of build/.../xml instead?
|
The trouble is, we may have some of the copied XML files, but not all of them. For example, if all the tests finished except for The whole problem we're working around here is that there's no easy way to distinguish between a timeout and some other failure in a GitHub step (a major limitation, IMO). Another solution could be to use the Linux It would be something like: Maybe we could capture the exit code and store it as a step output to be read by the Parse JUnit step. WDYT? |
I meant we can check creation time of xml file (from finished tests) in parsing and throw error if one of them has "too old" creation time.
Sound good. Overall it would be better to avoid complicating build.gradle 😄 |
|
@chia7712 I took advice from this thread https://github.com/orgs/community/discussions/46992#discussioncomment-4961541 to capture the exit code. I tested it with a 5s timeout here https://github.com/apache/kafka/actions/runs/10752630233/job/29821166851, seems to work. I think this is a better solution than fiddling with files. |
chia7712
left a comment
There was a problem hiding this comment.
LGTM but it would be better to test timeout again before merging :)
This reverts commit 019a4e9.
…ache#17121) Fixes an issue where the CI workflow could appear to be successful in the event of a timeout and no failing tests. Instead of using Github Action's timeout, this patch makes use of the linux `timeout` command. This lets us capture the exit code and handle timeouts separately from a failed execution. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

Follow up from #17106, this patch fixes a bug in the workflow where the tests timeout but no JUnit errors are found. Since the test report is incomplete, this is a false positive for a build being green. We should fail the whole workflow if the JUnit tests timeout.