Skip to content

Commit

Permalink
[TEST] Fix RemoteClusterConnectionTests
Browse files Browse the repository at this point in the history
With PR #31574 we now ensure that connections are established under the proper
thread context. There is a test in RemoteClusterConnectionTests, however,
that shuts down the service while connecting. With the above change, a new kind
of exception can occur that the test is unaware of.
  • Loading branch information
ywelsch committed Jun 27, 2018
1 parent 263defd commit ba236f0
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@

import static java.util.Collections.emptyMap;
import static java.util.Collections.emptySet;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.iterableWithSize;
Expand Down Expand Up @@ -860,7 +861,13 @@ public void run() {
throw new AssertionError(x);
}
});
connection.updateSeedNodes(seedNodes, listener);
try {
connection.updateSeedNodes(seedNodes, listener);
} catch (Exception e) {
// it's ok if we're shutting down
assertThat(e.getMessage(), containsString("threadcontext is already closed"));
latch.countDown();
}
}
latch.await();
} catch (Exception ex) {
Expand Down

0 comments on commit ba236f0

Please sign in to comment.