Buggy code:
public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTestCase { protected static final String DEFAULT_COLLECTION = "collection1" ; private static final boolean DEBUG = false ; protected ZkTestServer zkServer ; private AtomicInteger homeCount = new AtomicInteger ( ) ; @ BeforeClass public static void beforeThisClass ( ) throws Exception { } @ Before @ Override public void setUp ( ) throws Exception { } protected String getCloudSolrConfig ( ) { } @ Override protected void createServers ( int numShards ) throws Exception { } protected void waitForRecoveriesToFinish ( String collection , ZkStateReader zkStateReader , boolean verbose ) throws Exception { } protected void waitForRecoveriesToFinish ( String collection , ZkStateReader zkStateReader , boolean verbose , boolean failOnTimeout ) throws Exception { } protected void waitForRecoveriesToFinish ( String collection , ZkStateReader zkStateReader , boolean verbose , boolean failOnTimeout , int timeoutSeconds ) throws Exception { log . info ( ( ( ( ( ( "Wait<seq2seq4repair_space>for<seq2seq4repair_space>recoveries<seq2seq4repair_space>to<seq2seq4repair_space>finish<seq2seq4repair_space>-<seq2seq4repair_space>collection:<seq2seq4repair_space>" + collection ) + "<seq2seq4repair_space>failOnTimeout:" ) + failOnTimeout ) + "<seq2seq4repair_space>timeout<seq2seq4repair_space>(sec):" ) + timeoutSeconds ) ) ; boolean cont = true ; int cnt = 0 ; while ( cont ) { if ( verbose ) System . out . println ( "-" ) ; boolean sawLiveRecovering = false ; zkStateReader . updateClusterState ( true ) ; ClusterState clusterState = zkStateReader . getClusterState ( ) ; Map < String , Slice > slices = clusterState . getSlicesMap ( collection ) ; assertNotNull ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>collection:" + collection ) , slices ) ; for ( Map . Entry < String , Slice > entry : slices . entrySet ( ) ) { Map < String , Replica > shards = entry . getValue ( ) . getReplicasMap ( ) ; for ( Map . Entry < String , Replica > shard : shards . entrySet ( ) ) { if ( verbose ) <START_BUG> System . out . println ( ( ( ( "rstate:" + ( shard . getValue ( ) . getStr ( STATE_PROP ) ) ) + "<seq2seq4repair_space>live:" ) + ( clusterState . liveNodesContain ( shard . getValue ( ) . getNodeName ( ) ) ) ) ) ; <END_BUG> String state = shard . getValue ( ) . getStr ( STATE_PROP ) ; if ( ( ( ( state . equals ( RECOVERING ) ) || ( state . equals ( SYNC ) ) ) || ( state . equals ( DOWN ) ) ) && ( clusterState . liveNodesContain ( shard . getValue ( ) . getStr ( NODE_NAME_PROP ) ) ) ) { sawLiveRecovering = true ; } } } if ( ( ! sawLiveRecovering ) || ( cnt == timeoutSeconds ) ) { if ( ! sawLiveRecovering ) { if ( verbose ) System . out . println ( "no<seq2seq4repair_space>one<seq2seq4repair_space>is<seq2seq4repair_space>recoverying" ) ; } else { if ( verbose ) System . out . println ( "Gave<seq2seq4repair_space>up<seq2seq4repair_space>waiting<seq2seq4repair_space>for<seq2seq4repair_space>recovery<seq2seq4repair_space>to<seq2seq4repair_space>finish.." ) ; if ( failOnTimeout ) { Diagnostics . logThreadDumps ( "Gave<seq2seq4repair_space>up<seq2seq4repair_space>waiting<seq2seq4repair_space>for<seq2seq4repair_space>recovery<seq2seq4repair_space>to<seq2seq4repair_space>finish.<seq2seq4repair_space>THREAD<seq2seq4repair_space>DUMP:" ) ; printLayout ( ) ; fail ( ( ( "There<seq2seq4repair_space>are<seq2seq4repair_space>still<seq2seq4repair_space>nodes<seq2seq4repair_space>recoverying<seq2seq4repair_space>-<seq2seq4repair_space>waited<seq2seq4repair_space>for<seq2seq4repair_space>" + timeoutSeconds ) + "<seq2seq4repair_space>seconds" ) ) ; return ; } } cont = false ; } else { Thread . sleep ( 1000 ) ; } cnt ++ ; } log . info ( ( "Recoveries<seq2seq4repair_space>finished<seq2seq4repair_space>-<seq2seq4repair_space>collection:<seq2seq4repair_space>" + collection ) ) ; } protected void assertAllActive ( String collection , ZkStateReader zkStateReader ) throws InterruptedException , KeeperException { } @ Override @ After public void tearDown ( ) throws Exception { } protected void printLayout ( ) throws Exception { } }

Fix:
System . out . println ( ( ( ( ( ( "replica:" + ( shard . getValue ( ) . getName ( ) ) ) + "<seq2seq4repair_space>rstate:" ) + ( shard . getValue ( ) . getStr ( STATE_PROP ) ) ) + "<seq2seq4repair_space>live:" ) + ( clusterState . liveNodesContain ( shard . getValue ( ) . getNodeName ( ) ) ) ) ) ;