Skip to content

Commit

Permalink
[FLINK-31897][tests] Fix the unstable test ClientTest#testRequestUnav…
Browse files Browse the repository at this point in the history
…ailableHost
  • Loading branch information
TanYuxin-tyx authored and zentol committed Apr 25, 2023
1 parent caf5c10 commit 918b873
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void testSimpleRequests() throws Exception {

/** Tests that a request to an unavailable host is failed with ConnectException. */
@Test
void testRequestUnavailableHost() throws Exception {
void testRequestUnavailableHost() {
AtomicKvStateRequestStats stats = new AtomicKvStateRequestStats();

MessageSerializer<KvStateInternalRequest, KvStateResponse> serializer =
Expand All @@ -243,7 +243,10 @@ void testRequestUnavailableHost() throws Exception {
try {
client = new Client<>("Test Client", 1, serializer, stats);

InetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLocalHost(), 0);
// Since no real servers are created based on the server address, the given fixed port
// is enough.
InetSocketAddress serverAddress =
new InetSocketAddress("flink-qs-client-test-unavailable-host", 12345);

KvStateInternalRequest request =
new KvStateInternalRequest(new KvStateID(), new byte[0]);
Expand Down

0 comments on commit 918b873

Please sign in to comment.