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 61eefc8 commit 7520025
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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 @@ -854,7 +855,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 7520025

Please sign in to comment.