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 [JDK17]kudu:integration test failed in native mode #3340 #3341

Merged
merged 1 commit into from Dec 7, 2021

Conversation

ffang
Copy link
Contributor

@ffang ffang commented Nov 26, 2021

No description provided.

@zbendhiba
Copy link
Contributor

@ffang can this be added in the same profile as jdk16-workarounds ?
there is a similar line here :

<argLine>--add-opens java.base/java.net=ALL-UNNAMED</argLine>

Maybe it will be good to refactor the config. WDYT ?

Copy link
Contributor

@ppalaga ppalaga left a comment

Choose a reason for hiding this comment

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

A custom argline is not an end user-friendly solution. Is there no Quarkus BuildItem for this?
If we keep relying on argline, then we need to document this on the given extension page,

@jamesnetherton
Copy link
Contributor

A custom argline is not an end user-friendly solution.

I think in this case, it's acceptable because we unfortunately need this hack in the itests:

https://github.com/apache/camel-quarkus/blob/main/integration-tests/kudu/src/main/java/org/apache/camel/quarkus/component/kudu/it/KuduInfrastructureTestHelper.java#L64

It's not required for users to do this in their apps AFAIK.

@ffang
Copy link
Contributor Author

ffang commented Dec 2, 2021

Hi @zbendhiba ,

profile jdk16-workarounds has already had this configuration, however it couldn't take effect in native profile, since they both have maven-failsafe-plugin, but with different goals. So I think we have to add it into both profiles.

Freeman

@ffang can this be added in the same profile as jdk16-workarounds ? there is a similar line here :

<argLine>--add-opens java.base/java.net=ALL-UNNAMED</argLine>

Maybe it will be good to refactor the config. WDYT ?

@ffang ffang closed this Dec 2, 2021
@ffang ffang reopened this Dec 2, 2021
@ffang
Copy link
Contributor Author

ffang commented Dec 2, 2021

A custom argline is not an end user-friendly solution.

I think in this case, it's acceptable because we unfortunately need this hack in the itests:

https://github.com/apache/camel-quarkus/blob/main/integration-tests/kudu/src/main/java/org/apache/camel/quarkus/component/kudu/it/KuduInfrastructureTestHelper.java#L64

It's not required for users to do this in their apps AFAIK.

Yes, this issue indeed from KuduInfrastructureTestHelper itself, which tries to access no-public field from java.net.InetAddress with reflection. This won't happen in users apps.

@ppalaga
Copy link
Contributor

ppalaga commented Dec 2, 2021

Thanks for the explanation @jamesnetherton and @ffang . Could we please have a big fat comment near the argLine saying that this is due to the nasty things we do in KuduInfrastructureTestHelper?

@ppalaga
Copy link
Contributor

ppalaga commented Dec 2, 2021

About where to put <argLine>--add-opens java.base/java.net=ALL-UNNAMED</argLine> given that java 11 is our baseline, where this should work and given that we need it for both plugins in all profiles, can't we just add

<properties>
  <!-- This is to allow the nasty things we do in KuduInfrastructureTestHelper -->
  <argLine>--add-opens java.base/java.net=ALL-UNNAMED</argLine>
</properties>

in the top profile-less context (and remove the old jdk16-workarounds profile altogether)?

@ffang
Copy link
Contributor Author

ffang commented Dec 3, 2021

About where to put <argLine>--add-opens java.base/java.net=ALL-UNNAMED</argLine> given that java 11 is our baseline, where this should work and given that we need it for both plugins in all profiles, can't we just add

<properties>
  <!-- This is to allow the nasty things we do in KuduInfrastructureTestHelper -->
  <argLine>--add-opens java.base/java.net=ALL-UNNAMED</argLine>
</properties>

in the top profile-less context (and remove the old jdk16-workarounds profile altogether)?

Hi @ppalaga ,

I may miss your point, but if we add

</dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <!-- This is to allow the "deep reflection" we do in KuduInfrastructureTestHelper -->
+                    <argLine>--add-opens java.base/java.net=ALL-UNNAMED</argLine>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>

in the pom.xml out of profiles, this can't affect the maven-failsafe-plugin configuration in native profile. The maven-failsafe-plugin configuration in native profile can't pick up this argLine and will fail with JDK17 in native mode. We need to add this argLine in native profile anyway.

Freeman

@ppalaga
Copy link
Contributor

ppalaga commented Dec 3, 2021

I spoke about <argLine> in <properties>, not plugin config. We should be able to hit both plugins that way.

@ffang
Copy link
Contributor Author

ffang commented Dec 3, 2021

I spoke about <argLine> in <properties>, not plugin config. We should be able to hit both plugins that way.

That's right, I will revise the PR soon.

Thanks!
Freeman

@ffang
Copy link
Contributor Author

ffang commented Dec 6, 2021

revised and squashed commits here
43d4560

Copy link
Contributor

@ppalaga ppalaga left a comment

Choose a reason for hiding this comment

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

Thanks @ffang!

@ppalaga ppalaga merged commit 3c9fc9c into apache:main Dec 7, 2021
@ffang ffang deleted the 3340 branch December 7, 2021 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants