@Override public void run() { Random random = LuceneTestCase.random(); int numSearches = 0; while (true && !stop) { numSearches++; try { // to come to the aid of their country. cloudClient.query(new SolrQuery(QUERIES[random.nextInt(QUERIES.length)])); } catch (Exception e) { System.err.println("QUERY REQUEST FAILED:"); e.printStackTrace(); if (e instanceof SolrServerException) { System.err.println("ROOT CAUSE:"); ((SolrServerException) e).getRootCause().printStackTrace(); } queryFails.incrementAndGet(); } try { Thread.sleep(random.nextInt(4000) + 300); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } log.info("num searches done:" + numSearches + " with " + queryFails + " fails"); }