diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 7a3471c32..1b7706d4a 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -19,21 +19,28 @@ jobs: fail-fast: false # This starts three jobs, setting these environment variables uniquely for the different jobs matrix: + java: [8, 11, 14] + os: [ubuntu-latest, windows-latest, macos-latest] include: - - os: ubuntu-latest - os: windows-latest os_build_args: -x integTest -x jacocoTestReport working_directory: X:\ os_java_options: -Xmx4096M - os: macos-latest os_build_args: -x integTest -x jacocoTestReport + # Only testing the LTS java version on mac and windows + exclude: + - os: windows-latest + java: [8, 14] + - os: macos-latest + java: [8, 14] runs-on: ${{ matrix.os }} steps: # This step uses the setup-java Github action: https://github.com/actions/setup-java - - name: Set Up JDK 11 + - name: Set Up JDK ${{ matrix.java }} uses: actions/setup-java@v1 with: - java-version: 11 + java-version: ${{ matrix.java }} # build index management - name: Checkout Branch uses: actions/checkout@v2 diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt index 10beef10f..83ac0e073 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt @@ -59,7 +59,7 @@ class WaitForForceMergeStep(private val action: ForceMergeAction) : Step(name, f // Get ActionTimeout if given, otherwise use default timeout of 12 hours val timeoutInSeconds: Long = action.configTimeout?.timeout?.seconds ?: FORCE_MERGE_TIMEOUT_IN_SECONDS - if (timeWaitingForForceMerge.toSeconds() > timeoutInSeconds) { + if (timeWaitingForForceMerge.seconds > timeoutInSeconds) { logger.error( "Force merge on [$indexName] timed out with" + " [$shardsStillMergingSegments] shards containing unmerged segments" diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index 874936330..3cc3a1bba 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -15,11 +15,11 @@ import org.opensearch.client.RequestOptions import org.opensearch.client.Response import org.opensearch.client.RestClient import org.opensearch.common.Strings +import org.opensearch.common.io.PathUtils import org.opensearch.common.settings.Settings import org.opensearch.indexmanagement.indexstatemanagement.util.INDEX_HIDDEN import org.opensearch.rest.RestStatus import java.nio.file.Files -import java.nio.file.Path import javax.management.MBeanServerInvocationHandler import javax.management.ObjectName import javax.management.remote.JMXConnectorFactory @@ -171,7 +171,7 @@ abstract class IndexManagementRestTestCase : ODFERestTestCase() { false ) proxy.getExecutionData(false)?.let { - val path = Path.of("$jacocoBuildPath/integTest.exec") + val path = PathUtils.get("$jacocoBuildPath/integTest.exec") Files.write(path, it) } }