diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java index f39cfc05d70..cc3ca384617 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java @@ -2676,7 +2676,8 @@ protected void waitForReplicationFromReplicas( .getIndexCommit() .getUserData() .get(SolrIndexWriter.COMMIT_TIME_MSEC_KEY); - if (Long.parseLong(servingVersion) == replicaIndexVersion) { + if (servingVersion != null + && Long.parseLong(servingVersion) == replicaIndexVersion) { break; } else { if (log.isInfoEnabled()) { @@ -2692,17 +2693,6 @@ protected void waitForReplicationFromReplicas( } } } else { - if (timeout.hasTimedOut()) { - logReplicaTypesReplicationInfo(collectionName, zkStateReader); - fail( - String.format( - Locale.ROOT, - "Timed out waiting for replica %s (%d) to replicate from leader %s (%d)", - pullReplica.getName(), - replicaIndexVersion, - leader.getName(), - leaderIndexVersion)); - } if (leaderIndexVersion > replicaIndexVersion) { if (log.isInfoEnabled()) { log.info( @@ -2722,6 +2712,17 @@ protected void waitForReplicationFromReplicas( } } } + if (timeout.hasTimedOut()) { + logReplicaTypesReplicationInfo(collectionName, zkStateReader); + fail( + String.format( + Locale.ROOT, + "Timed out waiting for replica %s (%d) to replicate from leader %s (%d)", + pullReplica.getName(), + replicaIndexVersion, + leader.getName(), + leaderIndexVersion)); + } Thread.sleep(1000); } }