From 036200342d288b933963d895fae0642cc7837ae3 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 28 Oct 2024 17:04:23 +0530 Subject: [PATCH] fix: flaky test --- .../storage/postgresql/test/DbConnectionPoolTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/io/supertokens/storage/postgresql/test/DbConnectionPoolTest.java b/src/test/java/io/supertokens/storage/postgresql/test/DbConnectionPoolTest.java index 2a8aa753..3a7f5935 100644 --- a/src/test/java/io/supertokens/storage/postgresql/test/DbConnectionPoolTest.java +++ b/src/test/java/io/supertokens/storage/postgresql/test/DbConnectionPoolTest.java @@ -287,6 +287,16 @@ public void testMinimumIdleConnectionForTenants() throws Exception { Thread.sleep(1000); // let the new tenant be ready + for (int retry = 0; retry < 5; retry++) { + try { + assertEquals(10, start.getDbActivityCount("st1")); + break; + } catch (AssertionError e) { + Thread.sleep(1000); + continue; + } + } + assertEquals(10, start.getDbActivityCount("st1")); // change connection pool size