Skip to content

Commit 53b83c9

Browse files
authored
fix: cicd tests (#185)
1 parent 0377d03 commit 53b83c9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/test/java/io/supertokens/storage/postgresql/test/DbConnectionPoolTest.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void testDownTimeWhenChangingConnectionPoolSize() throws Exception {
138138
config
139139
), false);
140140

141-
Thread.sleep(3000); // let the new tenant be ready
141+
Thread.sleep(5000); // let the new tenant be ready
142142

143143
assertEquals(300, start.getDbActivityCount("st1"));
144144

@@ -157,7 +157,7 @@ public void testDownTimeWhenChangingConnectionPoolSize() throws Exception {
157157
successAfterErrorTime.set(System.currentTimeMillis());
158158
}
159159
} catch (StorageQueryException e) {
160-
if (e.getMessage().contains("Connection is closed")) {
160+
if (e.getMessage().contains("Connection is closed") || e.getMessage().contains("has been closed")) {
161161
if (firstErrorTime.get() == -1) {
162162
firstErrorTime.set(System.currentTimeMillis());
163163
}
@@ -174,6 +174,15 @@ public void testDownTimeWhenChangingConnectionPoolSize() throws Exception {
174174
} catch (BadPermissionException e) {
175175
errorCount.incrementAndGet();
176176
throw new RuntimeException(e);
177+
} catch (IllegalStateException e) {
178+
if (e.getMessage().contains("Please call initPool before getConnection")) {
179+
if (firstErrorTime.get() == -1) {
180+
firstErrorTime.set(System.currentTimeMillis());
181+
}
182+
} else {
183+
errorCount.incrementAndGet();
184+
throw e;
185+
}
177186
}
178187
});
179188
}
@@ -210,4 +219,4 @@ public void testDownTimeWhenChangingConnectionPoolSize() throws Exception {
210219
process.kill();
211220
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STOPPED));
212221
}
213-
}
222+
}

0 commit comments

Comments
 (0)