Skip to content

Commit

Permalink
Remove JDK8 support (#408)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler authored Mar 14, 2022
1 parent 5dbec30 commit 8550816
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
Build-ad:
strategy:
matrix:
java: [8, 11, 14]
java: [11, 14]
fail-fast: false

name: Build and Test Anomaly detection Plugin
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ allprojects {
}

plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.concurrent.atomic.AtomicBoolean;

import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
Expand Down Expand Up @@ -182,8 +181,6 @@ public void testThreeCategoricalFields() throws IOException {

@SuppressWarnings("unchecked")
public void testMoreThanTenThousandSingleEntityDetectors() throws IOException {
Assume.assumeFalse(System.getProperty("java.specification.version").compareTo("1.8") == 0);

SearchResponse mockResponse = mock(SearchResponse.class);
int totalHits = 1001;
when(mockResponse.getHits()).thenReturn(TestHelpers.createSearchHits(totalHits));
Expand Down Expand Up @@ -538,8 +535,6 @@ public <Request extends ActionRequest, Response extends ActionResponse> void doE

@SuppressWarnings("unchecked")
public void testMoreThanTenMultiEntityDetectors() throws IOException {
Assume.assumeFalse(System.getProperty("java.specification.version").compareTo("1.8") == 0);

String field = "a";
AnomalyDetector detector = TestHelpers.randomAnomalyDetectorUsingCategoryFields(detectorId, Arrays.asList(field));
SearchResponse detectorResponse = mock(SearchResponse.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Arrays;
import java.util.Locale;

import org.junit.Assume;
import org.junit.Before;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
Expand Down Expand Up @@ -126,8 +125,6 @@ public void setUp() throws Exception {

@SuppressWarnings("unchecked")
public void testValidateMoreThanThousandSingleEntityDetectorLimit() throws IOException {
Assume.assumeFalse(System.getProperty("java.specification.version").compareTo("1.8") == 0);

SearchResponse mockResponse = mock(SearchResponse.class);
int totalHits = maxSingleEntityAnomalyDetectors + 1;
when(mockResponse.getHits()).thenReturn(TestHelpers.createSearchHits(totalHits));
Expand Down Expand Up @@ -208,8 +205,6 @@ public void testValidateMoreThanThousandSingleEntityDetectorLimit() throws IOExc

@SuppressWarnings("unchecked")
public void testValidateMoreThanTenMultiEntityDetectorsLimit() throws IOException {
Assume.assumeFalse(System.getProperty("java.specification.version").compareTo("1.8") == 0);

String field = "a";
AnomalyDetector detector = TestHelpers.randomAnomalyDetectorUsingCategoryFields(detectorId, Arrays.asList(field));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.time.temporal.ChronoUnit;
import java.util.concurrent.TimeUnit;

import org.junit.Assume;
import org.junit.Before;
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.get.GetResponse;
Expand Down Expand Up @@ -149,8 +148,6 @@ public void testDisableADPlugin() throws IOException {
}

public void testMultipleTasks() throws IOException, InterruptedException {
Assume.assumeFalse(System.getProperty("java.specification.version").compareTo("1.8") == 0);

updateTransientSettings(ImmutableMap.of(MAX_BATCH_TASK_PER_NODE.getKey(), 2));

DetectionDateRange dateRange = new DetectionDateRange(startTime, endTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.stream.Collectors;

import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Ignore;
import org.opensearch.OpenSearchStatusException;
Expand Down Expand Up @@ -144,8 +143,6 @@ public void testStartHistoricalAnalysisWithUser() throws IOException {
}

public void testStartHistoricalAnalysisForSingleCategoryHCWithUser() throws IOException, InterruptedException {
Assume.assumeFalse(System.getProperty("java.specification.version").compareTo("1.8") == 0);

ingestTestData(testIndex, startTime, detectionIntervalInMinutes, type + "1", DEFAULT_IP, 2000, false);
ingestTestData(testIndex, startTime, detectionIntervalInMinutes, type + "2", DEFAULT_IP, 2000, false);
AnomalyDetector detector = TestHelpers
Expand Down Expand Up @@ -195,9 +192,6 @@ public void testStartHistoricalAnalysisForSingleCategoryHCWithUser() throws IOEx
}

public void testStartHistoricalAnalysisForMultiCategoryHCWithUser() throws IOException, InterruptedException {
// TODO: this test consistently fails on JDK8 only (too slow?), but passes on JDK11+
Assume.assumeFalse(System.getProperty("java.specification.version").compareTo("1.8") == 0);

ingestTestData(testIndex, startTime, detectionIntervalInMinutes, type + "1", DEFAULT_IP, 2000, false);
ingestTestData(testIndex, startTime, detectionIntervalInMinutes, type + "2", DEFAULT_IP, 2000, false);
ingestTestData(testIndex, startTime, detectionIntervalInMinutes, type + "3", "127.0.0.2", 2000, false);
Expand Down

0 comments on commit 8550816

Please sign in to comment.