patsonluk commented on code in PR #909: URL: https://github.com/apache/solr/pull/909#discussion_r911542761
########## solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateReaderTest.java: ########## @@ -196,4 +209,251 @@ public void testWatchedCollectionCreation() throws Exception { server.shutdown(); } } + + public void testForciblyRefreshAllClusterState() throws Exception { + Path zkDir = createTempDir("testForciblyRefreshAllClusterState"); + + ZkTestServer server = new ZkTestServer(zkDir); + + SolrZkClient zkClient = null; + ZkStateReader reader = null; + + try { + server.run(); + + zkClient = new SolrZkClient(server.getZkAddress(), OverseerTest.DEFAULT_CONNECTION_TIMEOUT); + ZkController.createClusterZkNodes(zkClient); + + reader = new ZkStateReader(zkClient); + reader.createClusterStateWatchersAndUpdate(); + reader.registerCore("c1"); // watching c1, so it should get non lazy reference + zkClient.makePath(ZkStateReader.COLLECTIONS_ZKNODE + "/c1", true); + + reader.forciblyRefreshAllClusterStateSlow(); + // Initially there should be no c1 collection. + assertNull(reader.getClusterState().getCollectionRef("c1")); + + ZkStateWriter writer = new ZkStateWriter(reader, new Stats()); Review Comment: Nice suggestion! I'm on it now! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org