Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test failures with java 21 #3770

Merged
merged 28 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7d2273a
Add property file into MI pack's conf folder
kalaiyarasiganeshalingam Oct 20, 2024
2e785a9
Add cert deployment
kalaiyarasiganeshalingam Oct 29, 2024
e962194
Remove condition
kalaiyarasiganeshalingam Oct 30, 2024
b195e6d
Update the implementation
kalaiyarasiganeshalingam Nov 4, 2024
8b539cf
Change snapse version
kalaiyarasiganeshalingam Nov 4, 2024
03c274c
Update error msg
kalaiyarasiganeshalingam Nov 5, 2024
75cb6bd
Update capp
kalaiyarasiganeshalingam Nov 6, 2024
19f2339
Create main.yml
kalaiyarasiganeshalingam Nov 7, 2024
32845be
Create maven.yml
kalaiyarasiganeshalingam Nov 7, 2024
38760ef
Merge branch 'wso2:master' into master
kalaiyarasiganeshalingam Nov 7, 2024
6f3cc6a
Update workflow
kalaiyarasiganeshalingam Nov 8, 2024
0b1b1c0
Revert the changes
kalaiyarasiganeshalingam Nov 8, 2024
6516006
Revert the changes
kalaiyarasiganeshalingam Nov 8, 2024
e9339ee
Remove duplicate setup
kalaiyarasiganeshalingam Nov 8, 2024
f1a5a9f
Add workflow
kalaiyarasiganeshalingam Nov 8, 2024
87322b0
Delete workflow
kalaiyarasiganeshalingam Nov 12, 2024
0ce14c2
Add java.util
kalaiyarasiganeshalingam Nov 13, 2024
d61e615
Remove unwanted exception
kalaiyarasiganeshalingam Nov 13, 2024
ab88432
Fix test failure
kalaiyarasiganeshalingam Nov 13, 2024
2a990df
Update script file
kalaiyarasiganeshalingam Nov 13, 2024
db31368
Update workflow
kalaiyarasiganeshalingam Nov 13, 2024
1184dd0
Add thread sleep
kalaiyarasiganeshalingam Nov 13, 2024
4b1d24e
Revert 1184dd085
kalaiyarasiganeshalingam Nov 17, 2024
aab0737
Update NEW_JAVA_TOOL_OPTIONS
kalaiyarasiganeshalingam Nov 17, 2024
f3cda42
Remove additional changes
kalaiyarasiganeshalingam Nov 17, 2024
6d23550
Update testcase
kalaiyarasiganeshalingam Nov 18, 2024
b823b0a
Revert pom file changes
kalaiyarasiganeshalingam Nov 18, 2024
650a6df
Use ConcurrentHashMap
kalaiyarasiganeshalingam Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/cluster-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@ jobs:
with:
distribution: 'temurin'
java-version: '17.0.6'
- name: Cluster Tests
- name: Cluster Tests with JDK 17
run: mvn -B clean install --file integration/pom.xml -P cluster-tests
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '21.0.4'
- name: Cluster Tests with JDK 21
run: mvn -B clean install --file integration/pom.xml -P cluster-tests
10 changes: 5 additions & 5 deletions .github/workflows/jdk-17-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Cache Maven packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11.0.12+7'
Expand All @@ -35,9 +35,9 @@ jobs:
- name: check java version
run: echo "JAVA_VERSION=$(java -version)"
- name: Build in jdk11
run: mvn -B clean install -DskipTests --file pom.xml
run: mvn clean install -DskipTests --file pom.xml
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.0.6'
Expand All @@ -48,4 +48,4 @@ jobs:
- name: Print segment
run: echo "Running build for segment ${{ matrix.profile }}"
- name: JDK 17 Tests
run: mvn -B clean install --file integration/pom.xml -P ${{ matrix.profile }} -fae
run: mvn clean install --file integration/pom.xml -P ${{ matrix.profile }} -fae
55 changes: 55 additions & 0 deletions .github/workflows/jdk-21-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Integration tests (Ubuntu, OpenJDK21)

on: [push, pull_request]

jobs:
ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: 1
profile: tests-mediators_tests-other_tests-sample
- id: 2
profile: tests-service_tests-patches_service-samples
- id: 3
profile: tests-transport_tests-platform
- id: 4
profile: management-api_dss-tests
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11.0.12+7'
- name: check mvn version
run: echo "MAVEN_VERSION=$(mvn -v)"
- name: check java version
run: echo "JAVA_VERSION=$(java -version)"
- name: Set JAVA_TOOL_OPTIONS
run: |
NEW_JAVA_TOOL_OPTIONS="${{ env.JAVA_TOOL_OPTIONS }} -Djdk.util.zip.disableZip64ExtraFieldValidation=true -Djdk.nio.zipfs.allowDotZipEntry=true --add-opens=java.base/java.net=ALL-UNNAMED"
echo "JAVA_TOOL_OPTIONS=$NEW_JAVA_TOOL_OPTIONS" >> $GITHUB_ENV
- name: Build in jdk11
run: mvn clean install -DskipTests --file pom.xml
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21.0.4'
- name: check mvn version
run: echo "MAVEN_VERSION=$(mvn -v)"
- name: check java version
run: echo "JAVA_VERSION=$(java -version)"
- name: Print segment
run: echo "Running build for segment ${{ matrix.profile }}"
- name: JDK 21 Tests
run: mvn clean install --file integration/pom.xml -P ${{ matrix.profile }} -fae
4 changes: 1 addition & 3 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ jobs:
- name: Build with Maven
run: mvn -B clean install -P smoke-tests --file pom.xml -fae
windows:

runs-on: windows-latest

steps:
- name: Configure Git to support long paths
run: git config --global core.longpaths true
- name: Verify Git configuration for long paths
run: git config --global core.longpaths
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: joschi/setup-jdk@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11.0.12+7'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration tests (Windows, OpenJDK8)
name: Integration tests (Windows, OpenJDK11)

on: [push]

Expand All @@ -12,7 +12,7 @@ jobs:
run: git config --system core.longpaths true
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: joschi/setup-jdk@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
Expand All @@ -28,7 +28,7 @@ jobs:
run: git config --system core.longpaths true
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: joschi/setup-jdk@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
Expand All @@ -44,7 +44,7 @@ jobs:
run: git config --system core.longpaths true
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: joschi/setup-jdk@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Please follow the steps below to build WSO2 Micro Integrator from the source cod
2. Run the maven command `mvn clean install` from the root directory of the repository.
3. The generated Micro Integrator distribution can be found at `micro-integrator/distribution/target/wso2mi-<version>.zip`.

Please note that the product can be build using only JDK 11 but the integration tests can be run in either JDK 11 or 17.
Please note that the product can be build using only JDK 11 but the integration tests can be run in either JDK 11, 17 or 21.

#### Building the Docker image

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

import javax.xml.stream.XMLStreamException;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
Expand Down Expand Up @@ -75,13 +76,14 @@ public void setUp() {
}

protected SynapseConfiguration getConfigurationFromSynapseXML() {
try {
FileInputStream fin = new FileInputStream(path + File.separator + "synapse.xml");
try (FileInputStream fin = new FileInputStream(path + File.separator + "synapse.xml")) {
return XMLConfigurationBuilder.getConfiguration(fin, new Properties());
} catch (FileNotFoundException e) {
fail("The synapse.xml file does not exist");
fail("The synapse.xml file does not exist at the path: " + path);
} catch (XMLStreamException e) {
fail("Error parsing the synapse.xml");
fail("Error parsing the synapse.xml file at the path: " + path);
} catch (IOException e) {
fail("IO error while reading the synapse.xml file at the path: " + path);
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion distribution/src/scripts/micro-integrator.bat
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ goto supportedJdk

:unknownJdk
echo Starting WSO2 MI (in unsupported JDK %JAVA_VERSION%)
echo [ERROR] WSO2 MI is supported only between JDK 11 and JDK 17"
echo [ERROR] WSO2 MI is supported only between JDK 11 and JDK 21"
goto end

:supportedJdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.BooleanSupplier;
import javax.xml.xpath.XPathExpressionException;

Expand Down Expand Up @@ -316,10 +315,10 @@ private Process startProcess(String workingDirectory, String[] cmdArray) throws
}

private void waitTill(BooleanSupplier predicate, int maxWaitTime, String task) throws InterruptedException {
long time = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(maxWaitTime);
long time = System.currentTimeMillis() + maxWaitTime * 1000L;
while (predicate.getAsBoolean() && System.currentTimeMillis() < time) {
log.info("waiting for server " + task);
TimeUnit.SECONDS.sleep(1);
Thread.sleep(1000);
}
}

Expand Down
Loading
Loading