private Date watchCoreStartAt(SolrClient client,final long timeout,final Date min) throws InterruptedException, IOException, SolrServerException {
  final long sleepInterval=200;
  long timeSlept=0;
  try (HttpSolrClient adminClient=adminClient(client)){
    SolrParams p=params("action","status","core","collection1");
    while (timeSlept < timeout) {
      QueryRequest req=new QueryRequest(p);
      req.setPath("/admin/cores");
      try {
        NamedList data=adminClient.request(req);
        for (        String k : new String[]{"status","collection1"}) {
          Object o=data.get(k);
          assertNotNull("core status rsp missing key: " + k,o);
          data=(NamedList)o;
        }
        Date startTime=(Date)data.get("startTime");
        assertNotNull("core has null startTime",startTime);
        if (null == min || startTime.after(min)) {
          return startTime;
        }
      }
 catch (      SolrException e) {
        if (500 != e.code()) {
          throw e;
        }
      }
      timeSlept+=sleepInterval;
      Thread.sleep(sleepInterval);
    }
    fail("timed out waiting for collection1 startAt time to exceed: " + min);
    return min;
  }
 }

private Date watchCoreStartAt ( SolrClient client , final long timeout , final Date min ) throws InterruptedException , IOException , SolrServerException { final long sleepInterval = 200 ; long timeSlept = 0 ; try ( HttpSolrClient adminClient = adminClient ( client ) ) { SolrParams p = params ( "action" , "status" , "core" , "collection1" ) ; while ( timeSlept < timeout ) { QueryRequest req = new QueryRequest ( p ) ; req . setPath ( "/admin/cores" ) ; try { NamedList data = adminClient . request ( req ) ; for ( String k : new String [ ] { "status" , "collection1" } ) { Object o = data . get ( k ) ; assertNotNull ( "core status rsp missing key: " + k , o ) ; data = ( NamedList ) o ; } Date startTime = ( Date ) data . get ( "startTime" ) ; assertNotNull ( "core has null startTime" , startTime ) ; if ( null == min || startTime . after ( min ) ) { return startTime ; } } catch ( SolrException e ) { if ( 500 != e . code ( ) ) { throw e ; } } timeSlept += sleepInterval ; Thread . sleep ( sleepInterval ) ; } fail ( "timed out waiting for collection1 startAt time to exceed: " + min ) ; return min ; } }
polls the solrcore stats using the specified client until the " starttime " time for collection is after the specified " min " . will loop for at most " timeout " milliseconds before throwing an assertion failure .
