Github user gerlowskija commented on a diff in the pull request: https://github.com/apache/lucene-solr/pull/425#discussion_r204601140 --- Diff: solr/core/src/test/org/apache/solr/cloud/TestPullReplicaErrorHandling.java --- @@ -151,12 +151,14 @@ public void testCantConnectToPullReplica() throws Exception { assertNumDocs(10 + i, leaderClient); } } - try (HttpSolrClient pullReplicaClient = getHttpSolrClient(s.getReplicas(EnumSet.of(Replica.Type.PULL)).get(0).getCoreUrl())) { - pullReplicaClient.query(new SolrQuery("*:*")).getResults().getNumFound(); - fail("Shouldn't be able to query the pull replica"); - } catch (SolrServerException e) { - //expected - } + + SolrServerException e = expectThrows(SolrServerException.class, () -> { + try(HttpSolrClient pullReplicaClient = getHttpSolrClient(s.getReplicas(EnumSet.of(Replica.Type.PULL)).get(0).getCoreUrl())) { + pullReplicaClient.query(new SolrQuery("*:*")).getResults().getNumFound(); + } + }); + assertTrue("Shouldn't be able to query the pull replica", e.getMessage().contains("refused connection")); --- End diff -- [-1] I like the idea, and agree this is a good assertion to add, but I'd rather not add it in this PR since it's intended to be a pure refactor. Would you mind removing this assertion?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org