Skip to content

Commit

Permalink
backport cve fix and improve restart IT
Browse files Browse the repository at this point in the history
Signed-off-by: Kaituo Li <[email protected]>
  • Loading branch information
kaituo committed Apr 22, 2022
1 parent b5dcd92 commit 6854e94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ configurations.all {
if (it.state != Configuration.State.UNRESOLVED) return
resolutionStrategy {
force "joda-time:joda-time:${versions.joda}"
force "com.fasterxml.jackson.core:jackson-core:2.12.6"
force "com.fasterxml.jackson.core:jackson-core:2.13.2"
force "commons-logging:commons-logging:${versions.commonslogging}"
force "org.apache.httpcomponents:httpcore:${versions.httpcore}"
force "commons-codec:commons-codec:${versions.commonscodec}"
Expand Down Expand Up @@ -604,9 +604,9 @@ dependencies {

// force Jackson version to avoid version conflict issue
implementation 'software.amazon.randomcutforest:randomcutforest-serialization:2.0.1'
implementation "com.fasterxml.jackson.core:jackson-core:2.12.6"
implementation "com.fasterxml.jackson.core:jackson-databind:2.12.6"
implementation "com.fasterxml.jackson.core:jackson-annotations:2.12.6"
implementation "com.fasterxml.jackson.core:jackson-core:2.13.2"
implementation "com.fasterxml.jackson.core:jackson-databind:2.13.2.2"
implementation "com.fasterxml.jackson.core:jackson-annotations:2.13.2"
compile files('lib/randomcutforest-parkservices-2.0.1.jar')
compile files('lib/randomcutforest-core-2.0.1.jar')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ private void simulateHCADStartDetector(
end = begin.plus(intervalMinutes, ChronoUnit.MINUTES);
try {
getDetectionResult(detectorId, begin, end, client);
} catch (Exception e) {}
} catch (Exception e) {
LOG.info("Unexpected exception", e);
}
}
// It takes time to wait for model initialization
long startTime = System.currentTimeMillis();
Expand Down Expand Up @@ -368,7 +370,7 @@ private void bulkIndexTrainData(String datasetName, List<JsonObject> data, int t
toHttpEntity(bulkRequestBuilder.toString()),
ImmutableList.of(new BasicHeader(HttpHeaders.USER_AGENT, "Kibana"))
);
Thread.sleep(1_000);
Thread.sleep(5_000);
waitAllSyncheticDataIngested(trainTestSplit, datasetName, client);
}

Expand All @@ -392,7 +394,7 @@ private void bulkIndexTestData(List<JsonObject> data, String datasetName, int tr
}

private void waitAllSyncheticDataIngested(int expectedSize, String datasetName, RestClient client) throws Exception {
int maxWaitCycles = 3;
int maxWaitCycles = 12;
do {
Request request = new Request("POST", String.format(Locale.ROOT, "/%s/_search", datasetName));
request
Expand Down Expand Up @@ -427,7 +429,7 @@ private void waitAllSyncheticDataIngested(int expectedSize, String datasetName,
request = new Request("POST", String.format(Locale.ROOT, "/%s/_refresh", datasetName));
client.performRequest(request);
}
Thread.sleep(1_000);
Thread.sleep(5_000);
} while (maxWaitCycles-- >= 0);
}

Expand Down Expand Up @@ -599,15 +601,8 @@ private void indexTrainData(String datasetName, List<JsonObject> data, int train
public void testRestartHCADDetector() throws Exception {
// TODO: this test case will run for a much longer time and timeout with security enabled
if (!isHttps()) {
try {
disableResourceNotFoundFaultTolerence();
verifyRestart("synthetic", 1, 8);
} catch (Throwable throwable) {
LOG.info("Retry restart test case", throwable);
cleanUpCluster();
wipeAllODFEIndices();
fail();
}
disableResourceNotFoundFaultTolerence();
verifyRestart("synthetic", 1, 8);
}
}

Expand Down

0 comments on commit 6854e94

Please sign in to comment.