Skip to content

Commit

Permalink
test: increase sleep time to allow GC to perform cleanup (#20019) (#2…
Browse files Browse the repository at this point in the history
…0023)

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.

Co-authored-by: Marco Collovati <marco@vaadin.com>
  • Loading branch information
vaadin-bot and mcollovati authored Sep 23, 2024
1 parent 72f2742 commit aa41079
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,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 aa41079

Please sign in to comment.