apache / apache/maven-surefire

[SUREFIRE-1891] Test isolation for forks does not apply to class loaders

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

Description

**[Daniel Elsner](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=delsner)** opened **[SUREFIRE-1891](https://issues.apache.org/jira/browse/SUREFIRE-1891?redirect=false)** and commented

When running surefire with `forkCount=1` and `reuseForks=false`, the loaded `.class` files are cached across forks. Therefore, when one wants to analyze the behavior of specific tests (e.g., which `.class` files are loaded into the JVM by the test), results will be incomplete. 

This has worked on older versions (I particularly tried `2.19.1`) and I am wondering whether this level of isolation was removed on purpose and if there is a way to manually return to the old default behavior of maximum isolation even for class loading.

Using:
- JDK 11 (Windows Server 2019 Datacenter)

- Surefire 3.0.0-M5

---

**Affects:** 3.0.0-M5

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by reproducing the behavior with forkCount=1 and reuseForks=false on Surefire 3.0.0-M5, comparing class loading across forks with the older 2.19.1 behavior; done means the intended class-loader isolation is established or the supported way to restore it is documented.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.