Assert candidate exhaustion disconnect reason in login regression

This commit is contained in:
layue13 committed 2026-09-27 23:10:20 +08:00
1 parent 9481403684
commit 14d9b59b05
1 file changed
+3 -2
@@ -2134,7 +2134,7 @@ final class ProxySessionListenerTest {
}
@Test
void failedBackendConnectSendsLoginDisconnectReason() throws Exception {
void exhaustedBackendCandidatesSendLoginDisconnectReason() throws Exception {
int unavailablePort;
try (ServerSocket unused = new ServerSocket(0, 8, InetAddress.getLoopbackAddress())) {
unavailablePort = unused.getLocalPort();
@@ -2152,7 +2152,8 @@ final class ProxySessionListenerTest {
sendLogin(client, "ConnectFailure");
var response = new java.io.ByteArrayInputStream(readFrame(new DataInputStream(client.getInputStream())));
assertEquals(0, readVarInt(response));
assertTrue(readString(response, 32767).contains("Could not connect"));
assertEquals("No entry server could be reached.",
new ObjectMapper().readTree(readString(response, 32767)).path("text").asText());
}
} finally {
listener.close().toCompletableFuture().get(5, TimeUnit.SECONDS);