apache / apache/maven-surefire

[SUREFIRE-1931] Integration test timeout causes zombie Java processes

Open
#2,921 0 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Alexander Kriegisch](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kriegaex)** opened **[SUREFIRE-1931](https://issues.apache.org/jira/browse/SUREFIRE-1931?redirect=false)** and commented

While re-testing the fix for SUREFIRE-1881, [tibordigana](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=tibordigana) and I agreed to add some integration tests in order to ensure correct behaviour. Everything is fine, the tests pass since Tibor fixed the problem. But the same tests would time out before the bugfix commits or in case of a regression due to an undetected edge case or a refactoring, accidentally re-introducing the problem. I also tested that the timeouts work as expected, simply back-porting the ITs to a branch before the bugfix.

Now here is the problem: While the timeouts fire correctly, the running test JVMs are not terminated and continue running as zombie processes.
* See [this PR](https://github.com/apache/maven-surefire/pull/355) for related discussion and details about how to detect the zombie processes
* See [this branch](https://github.com/kriegaex/maven-surefire/tree/before-SUREFIRE-1881) with the back-ported fixes, if you need a simple way to recreate the error situation.

The PR also describes how to reproduce the problem:

> If you want to easily reproduce the hanging JVMs directly in Surefire ITs, I ported both SUREFIRE-1881 tests from this PR back to the state before the merge. Simply check out my branch `[before-SUREFIRE-1881](https://github.com/kriegaex/maven-surefire/tree/before-SUREFIRE-1881)`, make a clean build without tests and then run the ITs. The easiest way is to temporarily add `Surefire1881IT` to the Failsafe config in the IT module. Of course you can also add the corresponding Maven CLI option.

Because SUREFIRE-1881 is fixed and this is a more general problem with regard to the Surefire test infrastructure as such, Tibor asked me to open a separate issue. I agree that this is the best approach, but please do read the information gathered in the closed PR. There, I also mentioned that MSHARED-867 might be related to this issue, but I am not sure. It just sounds similar and I found it during my research.

---

**Affects:** 3.0.0-M5

Contributor guide

Open the contributing guide

Research direction

Start with the related PR 355 and its zombie-process detection details. Reproduce the timeout using the before-SUREFIRE-1881 branch and the Surefire1881IT tests, enabled through the IT module's Failsafe configuration. Done means timed-out test JVMs are terminated and the integration tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.