You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2021/02/25 08:11:12 UTC

[lucene-solr] branch reference_impl_dev updated: @1391 Harden tests.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new 4792a71  @1391 Harden tests.
4792a71 is described below

commit 4792a71fc0f2ce9654fc1ea9b4a706e0a652e6dc
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Feb 25 02:10:48 2021 -0600

    @1391 Harden tests.
    
    Took 5 minutes
---
 solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java     | 2 +-
 .../org/apache/solr/handler/admin/MetricsHistoryHandlerTest.java    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
index b65cc22..3a8f1ec 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java
@@ -216,7 +216,7 @@ public class TestRestoreCore extends SolrJettyTestBase {
     TestReplicationHandlerBackup.runBackupCommand(masterJetty, ReplicationHandler.CMD_RESTORE, params);
 
     SolrTestCaseUtil.expectThrows(AssertionError.class, () -> {
-      for (int i = 0; i < 20; i++) {
+      for (int i = 0; i < 40; i++) {
         // this will throw an assertion once we get what we expect
         fetchRestoreStatus(baseUrl, DEFAULT_TEST_CORENAME);
         Thread.sleep(50);
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/MetricsHistoryHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/MetricsHistoryHandlerTest.java
index 49f81d4..9522b65 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/MetricsHistoryHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/MetricsHistoryHandlerTest.java
@@ -115,9 +115,9 @@ public class MetricsHistoryHandlerTest extends SolrCloudTestCase {
   public void testBasic() throws Exception {
     List<Pair<String, Long>> list = handler.getFactory().list(100);
 
-    if (list.size() == 0) {
-      TimeOut timeout = new TimeOut(3000, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
-      while (!timeout.hasTimedOut() && list.size() <= 1) {
+    if (list.size() < 2) {
+      TimeOut timeout = new TimeOut(5000, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
+      while (!timeout.hasTimedOut() && list.size() < 2) {
         Thread.sleep(10);
         list = handler.getFactory().list(100);
       }