From aa41079cd508c21ada316c6356aacf1c11e08a8e Mon Sep 17 00:00:00 2001 From: Vaadin Bot Date: Mon, 23 Sep 2024 12:32:31 +0200 Subject: [PATCH] test: increase sleep time to allow GC to perform cleanup (#20019) (#20023) 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 --- .../src/test/java/com/vaadin/flow/ComponentTrackerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java b/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java index 23f3129451c..794bafd09ea 100644 --- a/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java +++ b/flow-server/src/test/java/com/vaadin/flow/ComponentTrackerTest.java @@ -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; }