mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-31 02:06:21 +00:00
fix(java): avoid Java 11 HTTP fixture reuse (#10365)
This commit is contained in:
parent
85399d7ad1
commit
c1444bdc40
1 changed files with 13 additions and 2 deletions
|
|
@ -261,11 +261,14 @@ class DaemonSessionClientTest {
|
|||
CountDownLatch cancelReceived = new CountDownLatch(1);
|
||||
server.createContext("/session/session-1/cancel", exchange -> {
|
||||
cancelReceived.countDown();
|
||||
exchange.getResponseHeaders().set("Connection", "close");
|
||||
exchange.sendResponseHeaders(204, -1);
|
||||
exchange.close();
|
||||
});
|
||||
server.createContext("/session/session-1/detach", noContent());
|
||||
server.createContext("/session/session-2/detach", noContent());
|
||||
server.createContext("/session/session-1/detach",
|
||||
noContentAndCloseConnection());
|
||||
server.createContext("/session/session-2/detach",
|
||||
noContentAndCloseConnection());
|
||||
|
||||
try (DaemonClient daemon = newClient();
|
||||
DaemonSessionClient first = daemon.createSession()) {
|
||||
|
|
@ -2949,6 +2952,14 @@ class DaemonSessionClientTest {
|
|||
};
|
||||
}
|
||||
|
||||
private static HttpHandler noContentAndCloseConnection() {
|
||||
return exchange -> {
|
||||
exchange.getResponseHeaders().set("Connection", "close");
|
||||
exchange.sendResponseHeaders(204, -1);
|
||||
exchange.close();
|
||||
};
|
||||
}
|
||||
|
||||
private static void sendJson(HttpExchange exchange, int status, String body)
|
||||
throws IOException {
|
||||
byte[] bytes = body.getBytes(StandardCharsets.UTF_8);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue