Skip to content

Commit

Permalink
fix test failures
Browse files Browse the repository at this point in the history
Signed-off-by: AnnTian Shao <anntians@amazon.com>
  • Loading branch information
AnnTian Shao committed Jan 21, 2025
1 parent a24b673 commit 252100c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@ public static APIBlock readFrom(StreamInput input) throws IOException {
public static final Setting<Long> SETTING_INDEX_CREATION_DATE = Setting.longSetting(
SETTING_CREATION_DATE,
-1L,
-1L,
Property.IndexScope,
Property.NodeScope,
Property.UnmodifiableOnRestore
);
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ public void testTranslogGenerationSizeThreshold() {
}

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

{
Expand All @@ -617,7 +617,7 @@ public void testPrivateSettingsValidation() {
SettingsException.class,
() -> indexScopedSettings.validate(settings, randomBoolean())
);
assertThat(e, hasToString(containsString("unknown setting [index.creation_date]")));
assertThat(e, hasToString(containsString("unknown setting [index.version.upgraded]")));
}

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

// nothing should happen since we are ignoring private settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

package org.opensearch.test;

import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Setting.Property;
import org.opensearch.common.unit.TimeValue;
Expand Down Expand Up @@ -59,13 +58,6 @@ public final class InternalSettingsPlugin extends Plugin {
Property.IndexScope,
Property.NodeScope
);
public static final Setting<Long> INDEX_CREATION_DATE_SETTING = Setting.longSetting(
IndexMetadata.SETTING_CREATION_DATE,
-1,
-1,
Property.IndexScope,
Property.NodeScope
);
public static final Setting<TimeValue> TRANSLOG_RETENTION_CHECK_INTERVAL_SETTING = Setting.timeSetting(
"index.translog.retention.check_interval",
new TimeValue(10, TimeUnit.MINUTES),
Expand All @@ -78,7 +70,6 @@ public final class InternalSettingsPlugin extends Plugin {
public List<Setting<?>> getSettings() {
return Arrays.asList(
MERGE_ENABLED,
INDEX_CREATION_DATE_SETTING,
PROVIDED_NAME_SETTING,
TRANSLOG_RETENTION_CHECK_INTERVAL_SETTING,
RemoteConnectionStrategy.REMOTE_MAX_PENDING_CONNECTION_LISTENERS,
Expand Down

0 comments on commit 252100c

Please sign in to comment.