[MAGNOLIA-9007] File Handle leak in info.magnolia.test.junit5.JcrConfiguration.init() Created: 19/Jul/23  Updated: 19/Jul/23

Status: Open
Project: Magnolia
Component/s: testing
Affects Version/s: 6.2.16
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Andrey Zavodnik Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

The info.magnolia.test.junit5.JcrConfiguration.init() method creates an instance of a FileOutputStream, but doesn't close it. It means that file remains open until the instance is garbage collected. In our case the unit test fails sporadically because when unit test faild to delete temp files on the disk.

Sorry, I can't provide a test case, because the fault is dependent on race conditions.

Introduced in MAGNOLIA-8188

See https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/test/java/info/magnolia/test/junit5/JcrConfiguration.java#144


Generated at Mon Feb 12 04:37:47 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.