Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix;
import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
Expand All @@ -50,7 +49,6 @@
* after an add or update.
*/
@SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776")
@AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-18295") // 28-Jun-2026 flaky
public class ReplicationFactorTest extends AbstractFullDistribZkTestBase {

private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
Expand Down Expand Up @@ -492,10 +490,23 @@ protected int sendDoc(String collectionName, int docId) throws Exception {
return runAndGetAchievedRf(collectionName, up);
}

private int runAndGetAchievedRf(String collectionName, UpdateRequest up)
throws SolrServerException, IOException {
NamedList<Object> response = cloudClient.request(up, collectionName);
return cloudClient.getMinAchievedReplicationFactor(collectionName, response);
private int runAndGetAchievedRf(String collectionName, UpdateRequest up) throws Exception {
// This test may fail due to http proxy port manipulation, make sure we retry like
// sendDocsWithRetry/doDelete
final int maxRetries = 5;
int numRetries = 0;
while (true) {
try {
NamedList<Object> response = cloudClient.request(up, collectionName);
return cloudClient.getMinAchievedReplicationFactor(collectionName, response);
} catch (SolrServerException | IOException exc) {
if (++numRetries > maxRetries) {
throw exc;
}
log.warn("Update failed, retrying ({}/{}) ...", numRetries, maxRetries, exc);
Thread.sleep(1000);
}
}
}

protected void assertRf(int expected, String explain, int actual) throws Exception {
Expand Down
Loading