I use IDE to run test multiple times. It failed only once here.

I also did some changes in the test code.

I removed the line

https://github.com/apache/tomee/blob/7318a1db025878b3f1f56587c60b47a14d55ef68/container/openejb-core/src/test/java/org/apache/openejb/resource/AutoConnectionTrackerTest.java#L162

This made test many times faster. It is not needed. This tests non leaking business method so we expect everything to be cleared.

Also I removed the all the code that waits for log messages. I left only the line

assertEquals(message, times, logCapture.find(message).size());

There is no need to wait for anything. All the waiting is already done for the first and second tests in

runTest method

Regarding

System.gc();

It is needed only for the tests that leak so I removed it from all other tests.

Third and fourth test are run in the main thread and there is no need to wait before processing the log to.

You can see the change here :
https://github.com/doychin/tomee/commit/76e090b482825682a859d6a1637f572d8128f30a

In case you like it I can create PR.

On 6.1.2019 г. 19:47, David Blevins-2 [via TomEE & OpenEJB] wrote:
> On Jan 6, 2019, at 2:25 AM, Doychin Bondzhev <[hidden email] </user/SendEmail.jtp?type=node&node=4687291&i=0>> wrote:
>
> I would like to investigate this issue: https://issues.apache.org/jira/browse/TOMEE-2403
>
> Where I can get more detailed error log regarding this issue?
>
> I tried to run the test locally but it works.

Here's a technique I use sometimes to check random failures:

    $ for n in {1..50}; do mvn clean install -Dtest=AutoConnectionTrackerTest 2>&1 | tee run-$n.log; done

So far 3 out 17 have failed.  Debugging them will still be a pain in the butt, but at least there's some hope.


My shallow observation is that the approach taken in the test itself looks conspicuous.  Particularly, I'd say this test is not "correct" until it can pass without the System.gc() statements.

 - https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/resource/AutoConnectionTrackerTest.java#L197

More importantly, this method is using thread sleeps and retries to wait for log output which *will* cause random failures.  We should have a discussion on if there is a better way to make this more deterministic.

 - https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/resource/AutoConnectionTrackerTest.java#L216

Testing log output can work, however the test logic is ultimately "if you do or don't see this message in n seconds, we're good."  It needs to be "if you do or don't see this message *when the test is over*, we're good."

Since it's looking in log output, one way to do that might be to simply log a "test complete" statement (perhaps with a random number on it), and then wait for that in the log output.


-David





*signature.asc* (499 bytes) Download Attachment <http://tomee-openejb.979440.n4.nabble.com/attachment/4687291/0/signature.asc>


------------------------------------------------------------------------
If you reply to this email, your message will be added to the discussion below: http://tomee-openejb.979440.n4.nabble.com/Investigating-https-issues-apache-org-jira-browse-TOMEE-2403-tp4687290p4687291.html To start a new topic under TomEE Dev, email [email protected] To unsubscribe from TomEE Dev, click here <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=982480&code=ZG95Y2hpbkBkc29mdC1iZy5jb218OTgyNDgwfC0xNTI2MjM5MTA3>. NAML <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


--
Doychin Bondzhev
dSoft-Bulgaria Ltd.
PowerPro - billing & provisioning solution for Service providers
http://www.dsoft-bg.com/
Mobile: +359888243116

<<attachment: doychin.vcf>>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to