Fix test failures due to missing bdb close

This commit is contained in:
Alex Osborne
2026-03-10 11:37:22 +09:00
parent 5b3117644b
commit 3c3ae15a7c
2 changed files with 30 additions and 5 deletions
@@ -55,6 +55,7 @@ import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -167,6 +168,22 @@ public class CookieFetchHTTPIntegrationTest extends ProcessorTestBase {
FileUtils.deleteDirectory(staticTempDir.toFile());
}
@AfterEach
protected void afterEach() throws Exception {
if (fetcher != null) {
fetcher.stop();
}
if (bdbCookieStore != null) {
bdbCookieStore.stop();
}
if (simpleCookieStore != null) {
simpleCookieStore.stop();
}
if (bdb != null) {
bdb.close();
}
}
public static class AlwaysLocalhostServerCache extends ServerCache {
protected static final InetAddress LOCALHOST;
static {
@@ -132,10 +132,18 @@ public class FetchHTTP2Test {
@AfterEach
public void afterEach() {
fetcher.stop();
cookieStore.stop();
bdb.stop();
recorder.cleanup();
if (fetcher != null) {
fetcher.stop();
}
if (cookieStore != null) {
cookieStore.stop();
}
if (bdb != null) {
bdb.close();
}
if (recorder != null) {
recorder.cleanup();
}
}
@Test
@@ -305,4 +313,4 @@ public class FetchHTTP2Test {
assertEquals(-2, curi.getFetchStatus());
curi.getRecorder().cleanup();
}
}
}