Skip to content

Commit

Permalink
Attempt to fix some recent flakiness in testAwaitFullGc.
Browse files Browse the repository at this point in the history
I'm doing so by following the advice from martinrb@ in cl/26588812.

I don't really have a good way to test this, but presumably I'll notice eventually if the flakiness remains.

RELNOTES=n/a
PiperOrigin-RevId: 716747770
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jan 17, 2025
1 parent 22046a3 commit a3d5c96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ protected void finalize() {
// Use e.g. awaitClear or await(CountDownLatch) instead.
GcFinalization.awaitFullGc();

// If this test turns out to be flaky, add a second call to awaitFullGc()
// GcFinalization.awaitFullGc();
// Attempt to help with some flakiness that we've seen: b/387521512.
GcFinalization.awaitFullGc();

assertEquals(0, finalizerRan.getCount());
assertNull(ref.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ protected void finalize() {
// Use e.g. awaitClear or await(CountDownLatch) instead.
GcFinalization.awaitFullGc();

// If this test turns out to be flaky, add a second call to awaitFullGc()
// GcFinalization.awaitFullGc();
// Attempt to help with some flakiness that we've seen: b/387521512.
GcFinalization.awaitFullGc();

assertEquals(0, finalizerRan.getCount());
assertNull(ref.get());
Expand Down

0 comments on commit a3d5c96

Please sign in to comment.