Skip to content

Commit

Permalink
test: increase sleep time to allow GC to perform cleanup (#20019)
Browse files Browse the repository at this point in the history
On CI system the test randomly fails because the GC seems not
to clean up ComponentLocator memory within the 5 milliseconds.
However, running the test in isolation works fine.
This change increases the delay between the GC requests
to try to make the test more reliable.
  • Loading branch information
mcollovati authored and vaadin-bot committed Sep 23, 2024
1 parent 7734d3d commit 6af9436
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public void memoryIsReleased() throws Exception {
private boolean isCleared(Map<?, ?> map) throws InterruptedException {
for (int i = 0; i < 5; i++) {
System.gc();
if (map.size() == 0) {
if (map.isEmpty()) {
return true;
}
Thread.sleep(1);
Thread.sleep(100);
}
return false;
}
Expand Down

0 comments on commit 6af9436

Please sign in to comment.