From 680741b795592aebf41248164c6d7e97e90c527c Mon Sep 17 00:00:00 2001 From: Alex Radu Date: Tue, 30 Jul 2024 10:26:46 +1000 Subject: [PATCH 1/2] Bump guava to 33.2.1-jre latest of right now to fix vulnerabilities. --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 4d1955898..0e3a83adb 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -29,7 +29,7 @@ ext { revEurekaClient = '1.10.10' revGroovy = '4.0.9' revGrpc = '1.57.2' - revGuava = '30.0-jre' + revGuava = '33.2.1-jre' revHamcrestAllMatchers = '1.8' revHealth = '1.1.4' revPostgres = '42.7.2' From 4c7aa0f271796bf1ce7fdbe91b2546c3ceb26d8f Mon Sep 17 00:00:00 2001 From: Alex Radu Date: Mon, 5 Aug 2024 10:18:28 +1000 Subject: [PATCH 2/2] Simplified waitForCacheFlush for PostgresPollDataDAOCacheTest. --- .../dao/PostgresPollDataDAOCacheTest.java | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/postgres-persistence/src/test/java/com/netflix/conductor/postgres/dao/PostgresPollDataDAOCacheTest.java b/postgres-persistence/src/test/java/com/netflix/conductor/postgres/dao/PostgresPollDataDAOCacheTest.java index 8b1c41efe..431766b6d 100644 --- a/postgres-persistence/src/test/java/com/netflix/conductor/postgres/dao/PostgresPollDataDAOCacheTest.java +++ b/postgres-persistence/src/test/java/com/netflix/conductor/postgres/dao/PostgresPollDataDAOCacheTest.java @@ -94,25 +94,11 @@ private List> queryDb(String query) throws SQLException { private void waitForCacheFlush() throws InterruptedException { long startTime = System.currentTimeMillis(); - long lastDiff = - System.currentTimeMillis() - ((PostgresPollDataDAO) pollDataDAO).getLastFlushTime(); + long lastFlushTime = ((PostgresPollDataDAO) pollDataDAO).getLastFlushTime(); - if (lastDiff == 0) { - return; - } - - while (true) { - long currentDiff = - System.currentTimeMillis() - - ((PostgresPollDataDAO) pollDataDAO).getLastFlushTime(); - - if (currentDiff < lastDiff || System.currentTimeMillis() - startTime > 1000) { - return; - } - - lastDiff = currentDiff; - - Thread.sleep(1); + while (System.currentTimeMillis() - startTime < 1000 + && lastFlushTime <= ((PostgresPollDataDAO) pollDataDAO).getLastFlushTime()) { + Thread.sleep(10); } }