Skip to content

Commit 0a78553

Browse files
committed
Fix testAutoFollowManyIndices
On a slow CI worker, the test was failing an assertion. Closes #41234
1 parent 6630d33 commit 0a78553

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.Arrays;
3232
import java.util.Collections;
3333
import java.util.List;
34+
import java.util.concurrent.TimeUnit;
3435

3536
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
3637
import static org.hamcrest.Matchers.equalTo;
@@ -149,7 +150,7 @@ public void testAutoFollowManyIndices() throws Exception {
149150
AutoFollowMetadata autoFollowMetadata = metaData[0].custom(AutoFollowMetadata.TYPE);
150151
assertThat(autoFollowMetadata.getFollowedLeaderIndexUUIDs().get("my-pattern"), hasSize((int) expectedVal1));
151152
assertThat(autoFollowStats[0].getNumberOfSuccessfulFollowIndices(), equalTo(expectedVal1));
152-
});
153+
}, 30, TimeUnit.SECONDS);
153154
} catch (AssertionError ae) {
154155
logger.warn("indices={}", Arrays.toString(metaData[0].indices().keys().toArray(String.class)));
155156
logger.warn("auto follow stats={}", Strings.toString(autoFollowStats[0]));
@@ -168,7 +169,7 @@ public void testAutoFollowManyIndices() throws Exception {
168169
AutoFollowMetadata autoFollowMetadata = metaData[0].custom(AutoFollowMetadata.TYPE);
169170
assertThat(autoFollowMetadata.getFollowedLeaderIndexUUIDs().get("my-pattern"), nullValue());
170171
assertThat(autoFollowStats[0].getAutoFollowedClusters().size(), equalTo(0));
171-
});
172+
}, 30, TimeUnit.SECONDS);
172173
} catch (AssertionError ae) {
173174
logger.warn("indices={}", Arrays.toString(metaData[0].indices().keys().toArray(String.class)));
174175
logger.warn("auto follow stats={}", Strings.toString(autoFollowStats[0]));
@@ -199,7 +200,7 @@ public void testAutoFollowManyIndices() throws Exception {
199200
// Ensure that there are no auto follow errors:
200201
// (added specifically to see that there are no leader indices auto followed multiple times)
201202
assertThat(autoFollowStats[0].getRecentAutoFollowErrors().size(), equalTo(0));
202-
});
203+
}, 30, TimeUnit.SECONDS);
203204
} catch (AssertionError ae) {
204205
logger.warn("indices={}", Arrays.toString(metaData[0].indices().keys().toArray(String.class)));
205206
logger.warn("auto follow stats={}", Strings.toString(autoFollowStats[0]));

0 commit comments

Comments
 (0)