Skip to content

Commit 107aa53

Browse files
authored
Reduce number of indices created in ClusterSettingsIT (opensearch-project#20681)
When the number indices created in this test was sufficiently high, tests would frequently hit this failure at some point when creating a file: ``` Caused by: java.nio.file.FileSystemException: /var/jenkins/workspace/gradle-check/search/server/build/testrun/internalClusterTest/temp/org.opensearch.cluster.settings.ClusterSettingsIT_129BF1D803EFDA59-001/tempDir-002/node_s0/nodes/0/_state/_a1_Asserting_0.doc: Too many open files at org.apache.lucene.tests.mockfile.HandleLimitFS.onOpen(HandleLimitFS.java:67) at org.apache.lucene.tests.mockfile.HandleTrackingFS.callOpenHook(HandleTrackingFS.java:82) at org.apache.lucene.tests.mockfile.HandleTrackingFS.newOutputStream(HandleTrackingFS.java:163) at java.****/java.nio.file.Files.newOutputStream(Files.java:215) ``` This commit changes the random range from [10, 50] to be a fixed value of 3. This still gets the same coverage without unnecessarily increasing test runtime and introducing flakiness around file handle limits. Signed-off-by: Andrew Ross <andrross@amazon.com>
1 parent ca5d599 commit 107aa53

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/src/internalClusterTest/java/org/opensearch/cluster/settings/ClusterSettingsIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,7 @@ public void testUserMetadata() {
570570
}
571571

572572
public void testWithMultipleIndexCreationAndVerifySettingRegisteredOnce() {
573-
int randomInt = randomIntBetween(10, 50);
574-
for (int i = 0; i < randomInt; i++) {
573+
for (int i = 0; i < 3; i++) {
575574
String indexName = "test" + i;
576575
assertAcked(prepareCreate(indexName).setSettings(Settings.builder().put(IndexMetadata.SETTING_BLOCKS_METADATA, true)));
577576
assertBlocked(client().admin().indices().prepareGetSettings(indexName), IndexMetadata.INDEX_METADATA_BLOCK);

0 commit comments

Comments
 (0)