Refactored config REST API tests to avoid unsafe patterns causing memory leaks#5934
Conversation
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
|
This should fix the remaining memory leak test issues. This is a big change, but it is a quite schematic code change. |
src/integrationTest/java/org/opensearch/security/api/AbstractApiIntegrationTest.java
Show resolved
Hide resolved
|
@nibix Any idea why this shows up ~700 times in the output? Edit: More of the stack trace: |
|
Looks like the DLS clause in |
Before we removed the randomized testing framework, these were just random strings. I was under the impression that validation was tested here, but I am not sure. |
|
@willyborankin @DarshitChanpura can we get another review on this? |
DarshitChanpura
left a comment
There was a problem hiding this comment.
LGTM. Thanks @nibix .
f56424b
into
opensearch-project:main
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5934 +/- ##
==========================================
- Coverage 73.83% 0 -73.84%
==========================================
Files 439 0 -439
Lines 26884 0 -26884
Branches 3980 0 -3980
==========================================
- Hits 19851 0 -19851
+ Misses 5148 0 -5148
+ Partials 1885 0 -1885 🚀 New features to boost your workflow:
|
Description
In #5915, we discovered that the config REST API integration tests cause memory leaks as they use static references across test class boundaries in an unsafe manner.
This PR refactores these tests so that these no longer share static cluster or mutable static configuration references across test classes. IMHO, one should strive for abolishing the abstract super classes for these tests alltogether, but this is outside of my time availability.
Issues Resolved
Fixes #5915
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.