Skip to content

Commit 252100c

Browse files
author
AnnTian Shao
committed
fix test failures
Signed-off-by: AnnTian Shao <[email protected]>
1 parent a24b673 commit 252100c

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,9 @@ public static APIBlock readFrom(StreamInput input) throws IOException {
582582
public static final Setting<Long> SETTING_INDEX_CREATION_DATE = Setting.longSetting(
583583
SETTING_CREATION_DATE,
584584
-1L,
585+
-1L,
585586
Property.IndexScope,
587+
Property.NodeScope,
586588
Property.UnmodifiableOnRestore
587589
);
588590
/**

server/src/test/java/org/opensearch/index/IndexSettingsTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ public void testTranslogGenerationSizeThreshold() {
608608
}
609609

610610
public void testPrivateSettingsValidation() {
611-
final Settings settings = Settings.builder().put(IndexMetadata.SETTING_CREATION_DATE, System.currentTimeMillis()).build();
611+
final Settings settings = Settings.builder().put(IndexMetadata.SETTING_VERSION_UPGRADED, Version.V_EMPTY).build();
612612
final IndexScopedSettings indexScopedSettings = new IndexScopedSettings(settings, IndexScopedSettings.BUILT_IN_INDEX_SETTINGS);
613613

614614
{
@@ -617,7 +617,7 @@ public void testPrivateSettingsValidation() {
617617
SettingsException.class,
618618
() -> indexScopedSettings.validate(settings, randomBoolean())
619619
);
620-
assertThat(e, hasToString(containsString("unknown setting [index.creation_date]")));
620+
assertThat(e, hasToString(containsString("unknown setting [index.version.upgraded]")));
621621
}
622622

623623
{
@@ -626,7 +626,7 @@ public void testPrivateSettingsValidation() {
626626
SettingsException.class,
627627
() -> indexScopedSettings.validate(settings, randomBoolean(), false, randomBoolean())
628628
);
629-
assertThat(e, hasToString(containsString("unknown setting [index.creation_date]")));
629+
assertThat(e, hasToString(containsString("unknown setting [index.version.upgraded]")));
630630
}
631631

632632
// nothing should happen since we are ignoring private settings

test/framework/src/main/java/org/opensearch/test/InternalSettingsPlugin.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
package org.opensearch.test;
3333

34-
import org.opensearch.cluster.metadata.IndexMetadata;
3534
import org.opensearch.common.settings.Setting;
3635
import org.opensearch.common.settings.Setting.Property;
3736
import org.opensearch.common.unit.TimeValue;
@@ -59,13 +58,6 @@ public final class InternalSettingsPlugin extends Plugin {
5958
Property.IndexScope,
6059
Property.NodeScope
6160
);
62-
public static final Setting<Long> INDEX_CREATION_DATE_SETTING = Setting.longSetting(
63-
IndexMetadata.SETTING_CREATION_DATE,
64-
-1,
65-
-1,
66-
Property.IndexScope,
67-
Property.NodeScope
68-
);
6961
public static final Setting<TimeValue> TRANSLOG_RETENTION_CHECK_INTERVAL_SETTING = Setting.timeSetting(
7062
"index.translog.retention.check_interval",
7163
new TimeValue(10, TimeUnit.MINUTES),
@@ -78,7 +70,6 @@ public final class InternalSettingsPlugin extends Plugin {
7870
public List<Setting<?>> getSettings() {
7971
return Arrays.asList(
8072
MERGE_ENABLED,
81-
INDEX_CREATION_DATE_SETTING,
8273
PROVIDED_NAME_SETTING,
8374
TRANSLOG_RETENTION_CHECK_INTERVAL_SETTING,
8475
RemoteConnectionStrategy.REMOTE_MAX_PENDING_CONNECTION_LISTENERS,

0 commit comments

Comments
 (0)