Skip to content

Commit

Permalink
Merge branch 'main' into cluster-manager-timeout-cat
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Mar 30, 2022
2 parents f1801c3 + 65cc56e commit e1a4be0
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 11 deletions.
21 changes: 17 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ plugins {
id 'opensearch.docker-support'
id 'opensearch.global-build-info'
id "com.diffplug.spotless" version "6.3.0" apply false
id "org.gradle.test-retry" version "1.3.1" apply false
}

apply from: 'gradle/build-complete.gradle'
Expand Down Expand Up @@ -232,7 +233,7 @@ allprojects {
tasks.withType(JavaCompile).configureEach { JavaCompile compile ->
// See please https://bugs.openjdk.java.net/browse/JDK-8209058
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_11) {
compile.options.compilerArgs << '-Werror'
compile.options.compilerArgs << '-Werror'
}
compile.options.compilerArgs << '-Xlint:auxiliaryclass'
compile.options.compilerArgs << '-Xlint:cast'
Expand Down Expand Up @@ -386,6 +387,18 @@ gradle.projectsEvaluated {
}
}

// test retry configuration
subprojects {
apply plugin: "org.gradle.test-retry"
tasks.withType(Test).configureEach {
retry {
failOnPassedAfterRetry = false
maxRetries = 3
maxFailures = 10
}
}
}

// eclipse configuration
allprojects {
apply plugin: 'eclipse'
Expand Down Expand Up @@ -445,9 +458,9 @@ allprojects {
tasks.named('eclipse') { dependsOn 'cleanEclipse', 'copyEclipseSettings' }

afterEvaluate {
tasks.findByName("eclipseJdt")?.configure {
dependsOn 'copyEclipseSettings'
}
tasks.findByName("eclipseJdt")?.configure {
dependsOn 'copyEclipseSettings'
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions jenkins/jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pipeline {
docker {
label 'AL2-X64'
/* See
https://github.com/opensearch-project/opensearch-build/blob/main/docker/ci/dockerfiles/build.ubuntu18.opensearch.x64.dockerfile
https://hub.docker.com/layers/ci-runner/opensearchstaging/ci-runner/ci-runner-ubuntu1804-build-v1/images/sha256-2c7bb2780bc08cd4e7e3c382ac53db414754dabd52f9b70e1c7e344dfb9a0e5e?context=explore
for docker image
*/
image 'opensearchstaging/ci-runner:ci-runner-ubuntu1804-build-v1'
Expand All @@ -16,7 +16,7 @@ pipeline {
JAVA14_HOME="/opt/java/openjdk-14"
JAVA17_HOME="/opt/java/openjdk-17"
JAVA8_HOME="/opt/java/openjdk-8"
JAVA_HOME="/opt/java/openjdk-14"
JAVA_HOME="/opt/java/openjdk-17"
}

stages {
Expand Down
2 changes: 1 addition & 1 deletion plugins/repository-azure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies {
api 'com.azure:azure-storage-blob:12.14.4'
api 'org.reactivestreams:reactive-streams:1.0.3'
api 'io.projectreactor:reactor-core:3.4.15'
api 'io.projectreactor.netty:reactor-netty:1.0.16'
api 'io.projectreactor.netty:reactor-netty:1.0.17'
api 'io.projectreactor.netty:reactor-netty-core:1.0.16'
api 'io.projectreactor.netty:reactor-netty-http:1.0.16'
api "org.slf4j:slf4j-api:${versions.slf4j}"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7720beb4f58a4379e6294d62766d2e9e1bfaf646
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo
// ClusterStateHealth fields
int numberOfNodes = (int) parsedObjects[i++];
int numberOfDataNodes = (int) parsedObjects[i++];
boolean hasDiscoveredMaster = (boolean) parsedObjects[i++];
boolean hasDiscoveredMaster = Boolean.TRUE.equals(parsedObjects[i++]);
int activeShards = (int) parsedObjects[i++];
int relocatingShards = (int) parsedObjects[i++];
int activePrimaryShards = (int) parsedObjects[i++];
Expand Down Expand Up @@ -151,7 +151,7 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo
// ClusterStateHealth fields
PARSER.declareInt(constructorArg(), new ParseField(NUMBER_OF_NODES));
PARSER.declareInt(constructorArg(), new ParseField(NUMBER_OF_DATA_NODES));
PARSER.declareBoolean(constructorArg(), new ParseField(DISCOVERED_MASTER));
PARSER.declareBoolean(optionalConstructorArg(), new ParseField(DISCOVERED_MASTER));
PARSER.declareInt(constructorArg(), new ParseField(ACTIVE_SHARDS));
PARSER.declareInt(constructorArg(), new ParseField(RELOCATING_SHARDS));
PARSER.declareInt(constructorArg(), new ParseField(ACTIVE_PRIMARY_SHARDS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,35 @@ public void testParseFromXContentWithDiscoveredMasterField() throws IOException
NamedXContentRegistry.EMPTY,
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
"{\"cluster_name\":\"535799904437:7-1-3-node\",\"status\":\"green\","
+ "\"timed_out\":false,\"number_of_nodes\":6,\"number_of_data_nodes\":3,\"discovered_master\":false,"
+ "\"timed_out\":false,\"number_of_nodes\":6,\"number_of_data_nodes\":3,\"discovered_master\":true,"
+ "\"active_primary_shards\":4,\"active_shards\":5,\"relocating_shards\":0,\"initializing_shards\":0,"
+ "\"unassigned_shards\":0,\"delayed_unassigned_shards\":0,\"number_of_pending_tasks\":0,"
+ "\"number_of_in_flight_fetch\":0,\"task_max_waiting_in_queue_millis\":0,"
+ "\"active_shards_percent_as_number\":100}"
)
) {

ClusterHealthResponse clusterHealth = ClusterHealthResponse.fromXContent(parser);
assertNotNull(clusterHealth);
assertThat(clusterHealth.getClusterName(), Matchers.equalTo("535799904437:7-1-3-node"));
assertThat(clusterHealth.getNumberOfNodes(), Matchers.equalTo(6));
assertThat(clusterHealth.hasDiscoveredMaster(), Matchers.equalTo(true));
}
}

public void testParseFromXContentWithoutDiscoveredMasterField() throws IOException {
try (
XContentParser parser = JsonXContent.jsonXContent.createParser(
NamedXContentRegistry.EMPTY,
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
"{\"cluster_name\":\"535799904437:7-1-3-node\",\"status\":\"green\","
+ "\"timed_out\":false,\"number_of_nodes\":6,\"number_of_data_nodes\":3,"
+ "\"active_primary_shards\":4,\"active_shards\":5,\"relocating_shards\":0,\"initializing_shards\":0,"
+ "\"unassigned_shards\":0,\"delayed_unassigned_shards\":0,\"number_of_pending_tasks\":0,"
+ "\"number_of_in_flight_fetch\":0,\"task_max_waiting_in_queue_millis\":0,"
+ "\"active_shards_percent_as_number\":100}"
)
) {
ClusterHealthResponse clusterHealth = ClusterHealthResponse.fromXContent(parser);
assertNotNull(clusterHealth);
assertThat(clusterHealth.getClusterName(), Matchers.equalTo("535799904437:7-1-3-node"));
Expand Down

0 comments on commit e1a4be0

Please sign in to comment.