diff --git a/.github/workflows/build-common.yml b/.github/workflows/build-common.yml index f023fdb5a24f..cb0b02871546 100644 --- a/.github/workflows/build-common.yml +++ b/.github/workflows/build-common.yml @@ -238,9 +238,11 @@ jobs: test: name: test${{ matrix.test-partition }} (${{ matrix.test-java-version }}, ${{ matrix.vm }}, indy ${{ matrix.test-indy }}) - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: + - ubuntu-latest test-java-version: - 8 - 11 @@ -259,16 +261,45 @@ jobs: test-indy: - false - true + include: + - os: windows-latest + test-java-version: 25 + vm: hotspot + test-partition: 0 + test-indy: false + - os: windows-latest + test-java-version: 25 + vm: hotspot + test-partition: 1 + test-indy: false + - os: windows-latest + test-java-version: 25 + vm: hotspot + test-partition: 2 + test-indy: false + - os: windows-latest + test-java-version: 25 + vm: hotspot + test-partition: 3 + test-indy: false exclude: - vm: ${{ inputs.skip-openj9-tests && 'openj9' || '' }} - test-java-version: 25-deny-unsafe vm: openj9 fail-fast: false + defaults: + run: + shell: bash steps: + - name: Support long paths + run: git config --system core.longpaths true + if: matrix.os == 'windows-latest' + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Free disk space run: .github/scripts/gha-free-disk-space.sh + if: matrix.os != 'windows-latest' - id: setup-test-java name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests @@ -300,6 +331,13 @@ jobs: - name: Start deadlock detector run: .github/scripts/deadlock-detector.sh + - name: Switch from Windows containers to Linux containers mode + if: matrix.os == 'windows-latest' + run: | + "/c/Program Files/Docker/Docker/DockerCli.exe" -SwitchLinuxEngine + # Wait for Docker deamon to restart + sleep 30 + - name: Setup Gradle uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 with: @@ -434,6 +472,7 @@ jobs: - name: Free disk space run: .github/scripts/gha-free-disk-space.sh + if: matrix.os != 'windows-latest' - name: Set up JDK for running Gradle uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 diff --git a/.github/workflows/pr-smoke-test-servlet-images.yml b/.github/workflows/pr-smoke-test-servlet-images.yml index cb013e29f461..35011513de25 100644 --- a/.github/workflows/pr-smoke-test-servlet-images.yml +++ b/.github/workflows/pr-smoke-test-servlet-images.yml @@ -38,6 +38,7 @@ jobs: - name: Free disk space run: .github/scripts/gha-free-disk-space.sh + if: matrix.os != 'windows-latest' - name: Set up JDK for running Gradle uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 diff --git a/instrumentation/async-http-client/async-http-client-1.8/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_8/AsyncHttpClientTest.java b/instrumentation/async-http-client/async-http-client-1.8/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_8/AsyncHttpClientTest.java index 5675dfc9786d..4819b5e7d35a 100644 --- a/instrumentation/async-http-client/async-http-client-1.8/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_8/AsyncHttpClientTest.java +++ b/instrumentation/async-http-client/async-http-client-1.8/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_8/AsyncHttpClientTest.java @@ -25,6 +25,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutionException; +import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.extension.RegisterExtension; class AsyncHttpClientTest extends AbstractHttpClientTest { @@ -109,6 +110,12 @@ protected void configure(HttpClientTestOptions.Builder optionsBuilder) { optionsBuilder.disableTestReadTimeout(); } + // On Windows, non-routable addresses timeout instead of failing fast, causing test timeout + // before the HTTP client can create a span, resulting in only the parent span. + if (OS.WINDOWS.isCurrentOs()) { + optionsBuilder.disableTestRemoteConnection(); + } + optionsBuilder.setHttpAttributes( endpoint -> { Set> attributes =