Skip to content

Commit fbf7589

Browse files
duncdrumclaude
andcommitted
[bugfix] Force HTTP/1.1 in AbstractHttpTest and fix mock expectations in TxnTest
Two fixes bundled here: 1. AbstractHttpTest.newHttpClient(): add .version(HTTP_1_1) to prevent RST_STREAM hangs. GetParameterTest (and 10 other RESTTest subclasses) were silently stalling under HTTP/2, causing the 45-minute CI unit-test timeout to trigger. Fixing the shared factory covers all subclasses in one place. 2. TransactionManagerTestHelper: add expect(isShuttingDownOrDown()).andReturn(false) to the EasyMock setup. Our TransactionManager.processSystemTasks() change added a pool.isShuttingDownOrDown() guard; the strict mock had no expectation for that call, causing TxnTest and ReusableTxnTest to fail with "Unexpected method call". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a2510ed commit fbf7589

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

exist-core/src/test/java/org/exist/http/AbstractHttpTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ public static String basicAuthorizationHeader(final String user, final String pa
103103
* @return a new {@link HttpClient}.
104104
*/
105105
public static HttpClient newHttpClient() {
106+
// Force HTTP/1.1: RST_STREAM is an HTTP/2 frame; using HTTP/1.1 eliminates that failure mode.
106107
return HttpClient.newBuilder()
108+
.version(HttpClient.Version.HTTP_1_1)
107109
.followRedirects(HttpClient.Redirect.NORMAL)
108110
.build();
109111
}

exist-core/src/test/java/org/exist/storage/txn/TransactionManagerTestHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ protected TransactionManager createTestableTransactionManager(final boolean expe
6969
expect(mockBrokerPool.get(Optional.of(mockSystemSubject))).andReturn(mockBroker).anyTimes();
7070
expect(mockBrokerPool.getSecurityManager()).andReturn(mockSecurityManager).anyTimes();
7171
expect(mockSecurityManager.getSystemSubject()).andReturn(mockSystemSubject).anyTimes();
72+
expect(mockBrokerPool.isShuttingDownOrDown()).andReturn(false).anyTimes();
7273

7374
final JournalManager mockJournalManager = createMock(JournalManager.class);
7475
final SystemTaskManager mockTaskManager = createMock(SystemTaskManager.class);

0 commit comments

Comments
 (0)