eclipse / microprofile-telemetry

microprofile telemetry
Apache License 2.0
19 stars 18 forks source link

Wait for the garbage collector before testing #224

Closed benjamin-confino closed 4 months ago

benjamin-confino commented 4 months ago

Resolves #225

This adds a loop that repeatedly calls System.gc and only terminates once it has detected that the GC has collected. (Or timesout and fails the test if it takes too long)

donbourne commented 4 months ago

We discussed in the community call that we'd comment out the test, but had some pushback from others about commenting out the only test for something required in the spec. This is our best attempt to make the test work reliably. Based on testing from @brunobat / @radcortez (using a System.gc() call) and our experience in Open Liberty cross-JVM builds, the approach used in this PR should work with most JVMs.

donbourne commented 4 months ago

@brunobat , can you guys please try this out with your test environment to see if it works? new version has been staged to sonatype that includes this code.

brunobat commented 4 months ago

yes, the fix works