Bump the jetty group across 1 directory with 7 updates#6373
Bump the jetty group across 1 directory with 7 updates#6373dependabot[bot] wants to merge 1 commit into
Conversation
|
according to copilot: I'll help you find a solution for the failing job. Let me start by retrieving the logs for that job.Now let me get the test file to understand what's failing:## Solution for Job 75920500154 The job is failing due to test failures in the Root Causes
Recommended FixesOption 1: Add Retry Logic with Exponential Backoff Modify private HttpResponse executeWithRetry(Request request, int maxRetries) throws IOException {
int retries = 0;
IOException lastException = null;
while (retries < maxRetries) {
try {
return executor.execute(request).returnResponse();
} catch (IOException e) {
lastException = e;
retries++;
if (retries < maxRetries) {
try {
Thread.sleep((long) Math.pow(2, retries) * 100); // Exponential backoff
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new IOException("Interrupted during retry", ie);
}
}
}
}
throw lastException;
}
@Override
protected void storeBinaryFile(final XmldbURI filePath, final byte[] content) throws Exception {
final HttpResponse response = executeWithRetry(
Request.Put(getRestUrl() + filePath.toString())
.setHeader("Content-Type", "application/octet-stream")
.bodyByteArray(content),
3
);
if(response.getStatusLine().getStatusCode() != SC_CREATED) {
throw new Exception("Unable to store binary file: " + filePath);
}
}Option 2: Increase Server Startup Timeout The @BeforeClass
public static void setupExecutor() {
// Add connection and socket timeout configuration
executor = Executor.newInstance()
.auth(new HttpHost("localhost", existWebServer.getPort()), ADMIN_DB_USER, ADMIN_DB_PWD)
.authPreemptive(new HttpHost("localhost", existWebServer.getPort()))
.use(PoolingHttpClientConnectionManager.newInstance());
// Wait for server to be ready
waitForServerReady(10000); // 10 second timeout
}
private static void waitForServerReady(long timeoutMs) throws IOException {
long startTime = System.currentTimeMillis();
while (System.currentTimeMillis() - startTime < timeoutMs) {
try {
final HttpResponse response = executor.execute(
Request.Head(getRestUrl() + "/db/")
).returnResponse();
if (response.getStatusLine().getStatusCode() < 500) {
return; // Server is ready
}
} catch (IOException e) {
// Server not ready yet
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException("Interrupted waiting for server", e);
}
}
throw new IOException("Server failed to become ready within timeout");
}Option 3: Mark Tests as Flaky (Temporary) If the above solutions don't work, mark problematic tests to retry on failure: @Test
@Flaky(retries = 3)
public void readAndStreamBinaryRaw() throws IOException, JAXBException {
// test code
}Additional Notes
|
|
a bit more is wrong; asking Junie: Jetty 12 Multiple Embedded Servers — WorkaroundsJetty 12 introduced stricter lifecycle management and some global/static state that can conflict when multiple Server instances run in the same JVM. Here are the main approaches to work around this: 1. Serialize test execution (simplest fix)Ensure only one ExistWebServer is running at a time by running tests sequentially. In Maven Surefire: Or annotate test classes with JUnit 5's @ResourceLock / JUnit 4's @FixMethodOrder to prevent concurrent startup. 2. Use a single shared server instance (recommended for unit tests)Instead of each test class spinning up its own ExistWebServer, share one instance across the entire test suite using a JUnit @ClassRule or a JUnit 5 extension with @BeforeAll/@afterall at the suite level. This is the most robust approach — one server, one port, no conflicts. 3. Fork each test class into its own JVM processMaven Surefire can fork a new JVM per test class, completely isolating Jetty instances: With reuseForks=false, each test class gets a fresh JVM — no shared static state at all. The downside is slower test execution due to JVM startup overhead. 4. Isolate Jetty's ShutdownThread / global handlersJetty 12 registers a JVM shutdown hook (ShutdownThread) as a singleton. When a second Server starts, it may conflict. You can work around this by:
5. Use different ThreadPool instancesJetty 12 requires each Server to have its own QueuedThreadPool. If JettyStart reuses or shares a thread pool (e.g., via a static field), two servers will conflict. Ensure each JettyStart creates a fresh QueuedThreadPool: 6. Check for static/global Jetty state in JettyStartLook at org.exist.jetty.JettyStart for:
Recommended approach for ExistWebServer
The synchronized block you already have around port selection in useRandomPort mode is a good start — extending it to cover the full server.run() + server.shutdown() lifecycle would prevent the overlap that Jetty 12 dislikes. |
40f0e62 to
6d60ae5
Compare
Bumps the jetty group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | org.eclipse.jetty:jetty-server | `12.0.35` | `12.1.9` | | org.eclipse.jetty:jetty-xml | `12.0.35` | `12.1.9` | | org.eclipse.jetty:jetty-util | `12.0.35` | `12.1.9` | | org.eclipse.jetty:jetty-jmx | `12.0.35` | `12.1.9` | | org.eclipse.jetty:jetty-security | `12.0.35` | `12.1.9` | | org.eclipse.jetty:jetty-http | `12.0.35` | `12.1.9` | | org.eclipse.jetty:jetty-deploy | `12.0.35` | `12.1.9` | Updates `org.eclipse.jetty:jetty-server` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-xml` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-util` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-jmx` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-security` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-http` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-deploy` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-xml` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-util` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-jmx` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-security` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-http` from 12.0.35 to 12.1.9 Updates `org.eclipse.jetty:jetty-deploy` from 12.0.35 to 12.1.9 --- updated-dependencies: - dependency-name: org.eclipse.jetty:jetty-deploy dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-deploy dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-http dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-http dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-jmx dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-jmx dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-security dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-security dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-server dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-util dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-util dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-xml dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty - dependency-name: org.eclipse.jetty:jetty-xml dependency-version: 12.1.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: jetty ... Signed-off-by: dependabot[bot] <support@github.com>
6d60ae5 to
dd9bbfc
Compare

Bumps the jetty group with 7 updates in the / directory:
12.0.3512.1.912.0.3512.1.912.0.3512.1.912.0.3512.1.912.0.3512.1.912.0.3512.1.912.0.3512.1.9Updates
org.eclipse.jetty:jetty-serverfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-xmlfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-utilfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-jmxfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-securityfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-httpfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-deployfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-xmlfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-utilfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-jmxfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-securityfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-httpfrom 12.0.35 to 12.1.9Updates
org.eclipse.jetty:jetty-deployfrom 12.0.35 to 12.1.9