Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAMES-3724 - Enable leak detection mode is testing for test suite #913

Merged

Conversation

vttranlina
Copy link
Contributor

@vttranlina vttranlina force-pushed the JAMES-3724_TestingMode_LeakDetector_ForTest branch from 6e2a0c0 to f963131 Compare March 11, 2022 07:28
@vttranlina
Copy link
Contributor Author

WIP
This is my idea regarding the way to do it.
Create jvm.properties in classpath resources, declare testing mode. When creating the server, invoke org.apache.james.ExtraProperties#initialize for setting system properties.

Copy link
Contributor

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vttranlina vttranlina force-pushed the JAMES-3724_TestingMode_LeakDetector_ForTest branch from f963131 to 7063262 Compare March 14, 2022 01:33
@vttranlina vttranlina marked this pull request as ready for review March 14, 2022 01:33
pom.xml Show resolved Hide resolved
@chibenwa
Copy link
Contributor

<h1 class="result-regression">Regression</h1><p><span style="font-weight:bold">org.apache.james.lifecycle.api.LeakAwareTest.leakDetectionShouldCloseUnclosedResources</span></p><div style="text-align:right;">Failing for the past 1 build
          (Since <a href="https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-913/4/" class="model-link"><span style="width: 16px; height: 16px; " class="build-status-icon__wrapper icon-red icon-sm"><span class="build-status-icon__outer"><svg viewBox="0 0 24 24" focusable="false" class="svg-icon "><use href="https://ci-builds.apache.org/images/build-status/build-status-sprite.svg#build-status-static"></use></svg></span><svg viewBox="0 0 24 24" focusable="false" class="svg-icon icon-red icon-sm"><use href="https://ci-builds.apache.org/static/40b37e2d/images/build-status/build-status-sprite.svg#last-failed"></use></svg></span>#4</a> )
        </div><div style="text-align:right;"><a href="https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-913/4/testReport/junit/org.apache.james.lifecycle.api/LeakAwareTest/leakDetectionShouldCloseUnclosedResources/history">Took 0.14 sec.</a></div><div id="description"><div></div><div class="jenkins-buttons-row jenkins-buttons-row--invert"></div></div>
<h3>Stacktrace</h3><pre>org.apache.james.lifecycle.api.Disposable$LeakAware$LeakDetectorException
	at org.apache.james.lifecycle.api.LeakAwareTest.lambda$leakDetectionShouldCloseUnclosedResources$0(LeakAwareTest.java:101)
</pre><h3>Standard Output</h3><pre>03:14:48.190 [ERROR] o.a.j.l.a.Disposable$LeakAwareFinalizer - Leak detected! Resource org.apache.james.lifecycle.api.LeakAwareTest$LeakResourceSample$TestResource@ff0ab64 was not released before its referent was garbage-collected. 
This resource was instanced at: 
	org.apache.james.lifecycle.api.LeakAwareTest$LeakResourceSample#create:55
	org.apache.james.lifecycle.api.LeakAwareTest#leakDetectionShouldCloseUnclosedResources:96
	org.junit.platform.commons.util.ReflectionUtils#invokeMethod:688
	org.junit.jupiter.engine.execution.MethodInvocation#proceed:60
	org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation#proceed:131
	org.junit.jupiter.engine.extension.TimeoutExtension#intercept:149
	org.junit.jupiter.engine.extension.TimeoutExtension#interceptTestableMethod:140
	org.junit.jupiter.engine.extension.TimeoutExtension#interceptTestMethod:84
	org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall#lambda$ofVoidMethod$0:115
	org.junit.jupiter.engine.execution.ExecutableInvoker#lambda$invoke$0:105
	org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation#proceed:106
	org.junit.jupiter.engine.execution.InvocationInterceptorChain#proceed:64</pre>Regression

org.apache.james.lifecycle.api.LeakAwareTest.leakDetectionShouldCloseUnclosedResources
Failing for the past 1 build (Since [#4](https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-913/4/) )
[Took 0.14 sec.](https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-913/4/testReport/junit/org.apache.james.lifecycle.api/LeakAwareTest/leakDetectionShouldCloseUnclosedResources/history)
Stacktrace

org.apache.james.lifecycle.api.Disposable$LeakAware$LeakDetectorException
	at org.apache.james.lifecycle.api.LeakAwareTest.lambda$leakDetectionShouldCloseUnclosedResources$0(LeakAwareTest.java:101)

Standard Output

03:14:48.190 [ERROR] o.a.j.l.a.Disposable$LeakAwareFinalizer - Leak detected! Resource org.apache.james.lifecycle.api.LeakAwareTest$LeakResourceSample$TestResource@ff0ab64 was not released before its referent was garbage-collected. 
This resource was instanced at: 
	org.apache.james.lifecycle.api.LeakAwareTest$LeakResourceSample#create:55
	org.apache.james.lifecycle.api.LeakAwareTest#leakDetectionShouldCloseUnclosedResources:96
	org.junit.platform.commons.util.ReflectionUtils#invokeMethod:688
	org.junit.jupiter.engine.execution.MethodInvocation#proceed:60
	org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation#proceed:131
	org.junit.jupiter.engine.extension.TimeoutExtension#intercept:149
	org.junit.jupiter.engine.extension.TimeoutExtension#interceptTestableMethod:140
	org.junit.jupiter.engine.extension.TimeoutExtension#interceptTestMethod:84
	org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall#lambda$ofVoidMethod$0:115
	org.junit.jupiter.engine.execution.ExecutableInvoker#lambda$invoke$0:105
	org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation#proceed:106
	org.junit.jupiter.engine.execution.InvocationInterceptorChain#proceed:64

@vttranlina vttranlina force-pushed the JAMES-3724_TestingMode_LeakDetector_ForTest branch from 7063262 to 958e1f6 Compare March 14, 2022 09:06
Copy link
Contributor

@Arsnael Arsnael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And p;lease rebase on master :)

@vttranlina vttranlina force-pushed the JAMES-3724_TestingMode_LeakDetector_ForTest branch from 958e1f6 to 86f1aa2 Compare March 15, 2022 07:27
@chibenwa chibenwa merged commit e271aa9 into apache:master Mar 16, 2022
@vttranlina vttranlina deleted the JAMES-3724_TestingMode_LeakDetector_ForTest branch December 12, 2023 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants