Skip to content

Commit

Permalink
AssertBusy to allow for the decRefs to be dec-ed to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidan committed Feb 20, 2025
1 parent ebcba60 commit 83e37e6
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3010,18 +3010,19 @@ public void testFetchPhaseAccountsForSourceMemoryUsage() throws Exception {
.get();
if (fetchSearchResult != null) {
long usedBeforeResultDecRef = breaker.getUsed();
if (fetchSearchResult.decRef()) {
assertThat(usedBeforeResultDecRef, greaterThanOrEqualTo(48_000L));
// when releasing the result references we should clear at least 48_000 bytes (48 hits with sources of at least 1000
// bytes)
fetchSearchResult.decRef();
assertBusy(() -> {
long usedAfterResultDecRef = breaker.getUsed();
logger.info(
"--> usedBeforeResultDecRef: [{}], usedAfterResultDecRef: [{}]",
usedBeforeResultDecRef,
usedAfterResultDecRef
);
assertThat(usedBeforeResultDecRef, greaterThanOrEqualTo(48_000L));
// when releasing the result references we should clear at least 48_000 bytes (48 hits with sources of at least 1000
// bytes)
assertThat(usedBeforeResultDecRef - usedAfterResultDecRef, greaterThanOrEqualTo(48_000L));
}
});
}
}
}
Expand Down

0 comments on commit 83e37e6

Please sign in to comment.