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

Run CI with Java 17 and 21 #5874

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8,11]
java: [8,11,17,21]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ void bigNumbersSupported(@TempDir Path tempDir) throws Exception {
// When
final Path toUploadWithModifiedDate = Files.copy(toUpload, tempDir.resolve("upload-sample.txt"));
assertTrue(toUploadWithModifiedDate.toFile().setLastModified(9999999999999L)); // Would trigger IllegalArgumentException: last modification time '9999999999' is too big ( > 8589934591 ).
assertTrue(toUploadWithModifiedDate.toFile().setLastModified(123456L)); // To have a stable, within ranges, value to compare with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically rendering the test useless

This test ensures that the changes in 7a49cce

behave as expected.

It should fail in case the line

tar.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);

is removed.

We need to find some other way to verify this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to suggestions, the test breaks on Java 21 but I don't have much context here ...

Copy link
Member

@manusa manusa Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any more context about how does the test break in 21?
In any case, it's better to disable this test for Java 21 only (@DisabledOnJre(JAVA_21))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, going to disable the test instead, this is the outcome on Java 21:

java.lang.AssertionError: 
Expecting
  org.apache.commons.compress.archivers.tar.TarArchiveEntry@df31e1be
to have a property or a field named "lastModifiedTime" with value
  2286-11-20T17:46:39.999Z
but value was:
  2262-04-11T23:47:16.8547758Z

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is actually something misbehaving in that JDK

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test has been failing for me locally as well for a while now.

client.pods().inNamespace("default").withName("success-pod").file("/target-dir/file-name.txt")
.upload(toUploadWithModifiedDate);
// Then
Expand All @@ -312,7 +313,7 @@ void bigNumbersSupported(@TempDir Path tempDir) throws Exception {
final TarArchiveInputStream tar = new TarArchiveInputStream(new ByteArrayInputStream(tarBytes));
assertThat(tar.getNextEntry())
.hasFieldOrPropertyWithValue("name", "file-name.txt")
.hasFieldOrPropertyWithValue("lastModifiedTime", FileTime.fromMillis(9999999999999L));
.hasFieldOrPropertyWithValue("lastModifiedTime", FileTime.fromMillis(123456L));
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion platforms/karaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
<properties>
<karaf.version>4.4.5</karaf.version>
<osgi.version>6.0.0</osgi.version>
<pax.exam.version>4.13.5</pax.exam.version>
<!-- NOT Updated because of: https://github.com/ops4j/org.ops4j.pax.exam2/issues/1020#issuecomment-1011133020 causing instability in CI -->
<pax.exam.version>4.13.3</pax.exam.version>
</properties>

</project>
30 changes: 17 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@
<awaitility.version>4.2.1</awaitility.version>
<approvaltests.version>23.0.1</approvaltests.version>
<mockito.version>4.11.0</mockito.version>
<spock.version>2.3-groovy-4.0</spock.version>
<mockito-inline.version>4.11.0</mockito-inline.version>
<spock.version>2.4-M4-groovy-4.0</spock.version>

<conscrypt-openjdk-uber.bundle.version>1.4.2_1</conscrypt-openjdk-uber.bundle.version>
<generex.version>1.0.2</generex.version>
Expand Down Expand Up @@ -164,8 +165,7 @@
<maven.plugin.plugin.version>3.12.0</maven.plugin.plugin.version>
<gmavenplus-plugin.version>3.0.2</gmavenplus-plugin.version>
<gradle-api-maven-plugin.version>0.0.5</gradle-api-maven-plugin.version>
<jandex.plugin.version>1.2.3</jandex.plugin.version>
<jandex.version>2.4.4.Final</jandex.version>
<jandex.plugin.version>3.1.7</jandex.plugin.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<jkube.version>1.16.2</jkube.version>
<sonar-maven-plugin.version>3.11.0.3922</sonar-maven-plugin.version>
Expand Down Expand Up @@ -903,7 +903,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<version>${mockito-inline.version}</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -1095,7 +1095,7 @@
<version>${maven.invoker.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jboss.jandex</groupId>
<groupId>io.smallrye</groupId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this might cause issues with Quarkus. We need to verify that the Jandex versions are compatible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.jboss.jandex doesn't work with Java 21, and this is the solution I found in the wild, do we have any kind of nightly/snapshot tests we can use to verify the compatibility? Maybe @metacosm ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, maybe use jandex directly instead of the plugin? I think that would require adding empty beans.xml files, though…

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<artifactId>jandex-maven-plugin</artifactId>
<version>${jandex.plugin.version}</version>
<executions>
Expand All @@ -1107,13 +1107,6 @@
<inherited>true</inherited>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>${jandex.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
Expand Down Expand Up @@ -1172,7 +1165,7 @@
</plugin>
<!-- Create jandex index for faster performance in environments that use it -->
<plugin>
<groupId>org.jboss.jandex</groupId>
<groupId>io.smallrye</groupId>
<artifactId>jandex-maven-plugin</artifactId>
</plugin>
<plugin>
Expand Down Expand Up @@ -1581,6 +1574,17 @@
</plugins>
</build>
</profile>
<profile>
<id>java-17</id>
<activation>
<jdk>[17,)</jdk>
</activation>
<properties>
<mockito.version>5.11.0</mockito.version>
<mockito-inline.version>5.2.0</mockito-inline.version>
<karaf.itest.skip>true</karaf.itest.skip>
</properties>
</profile>
<profile>
<id>javadoc-test</id>
<build>
Expand Down
Loading