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

More fixes about running tests on JDK11 #9893

Merged
merged 7 commits into from
Mar 14, 2021

Conversation

eolivelli
Copy link
Contributor

Motivation

When you are running tests on JDK11 you encounter a lot of issues.
This patch includes a list of minor fixes that can be grouped.

Master issue #9578

Modifications

  • Upgrade Mockito to latest version
  • Add "--add-opens java.base/jdk.internal.loader=ALL-UNNAMED" in order to allow PowerMock to work
  • add JAXB into jcloud provider (we already have it on the classpath in production, it is only in order to let tests run)
  • Upgrade HDFS minicluster to 3.3.0
  • Pin netty-codec-http dependency to the same version of netty (inherited from HDFS client)
  • Use the same version of Jetty for hdfs-offload (old version does not work with JDK11)

Verifying this change

Tests must still run successfully on JDK8.

Once all tests are known to run on JDK11 we will switch CI tests runner to JDK11, this cannot be done in this PR.

@eolivelli
Copy link
Contributor Author

/pulsarbot run-failure-checks

pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@merlimat merlimat added this to the 2.8.0 milestone Mar 12, 2021
@eolivelli
Copy link
Contributor Author

@merlimat I have addressed your comments PTAL
thanks for your quick review

@eolivelli eolivelli requested a review from merlimat March 12, 2021 21:37
@codelipenghui codelipenghui merged commit c94d782 into apache:master Mar 14, 2021
fmiguelez pushed a commit to fmiguelez/pulsar that referenced this pull request Mar 16, 2021
### Motivation
When you are running tests on JDK11 you encounter a lot of issues.
This patch includes a list of minor fixes that can be grouped.

Master issue apache#9578 

### Modifications
- Upgrade Mockito to latest version
- Add  "--add-opens java.base/jdk.internal.loader=ALL-UNNAMED" in order to allow PowerMock to work
- add JAXB into jcloud provider (we already have it on the classpath in production, it is only in order to let tests run)
- Upgrade HDFS minicluster to 3.3.0
- Pin netty-codec-http dependency to the same version of netty (inherited from HDFS client)
- Use the same version of Jetty for hdfs-offload (old version does not work with JDK11)
@BewareMyPower
Copy link
Contributor

Hi, I just pull the latest master and when I ran a test with Intellij Idea, it failed to start with following error message

Unrecognized option: --add-opens
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I think it may be caused by this PR.

    <profile>
      <id>jdk11-tests</id>
      <activation>
        <jdk>[11,)</jdk>
      </activation>
      <properties>
        <test.additional.args> --add-opens java.base/jdk.internal.loader=ALL-UNNAMED </test.additional.args>
      </properties>
    </profile>

But even after I removed these lines from pom.xml, it still failed. Could you give some advice for JDK8 environment?

@eolivelli
Copy link
Contributor Author

eolivelli commented Mar 17, 2021

In IntelliJ check if it automatically enabled this profile. If so then simply unselect it.
That was my case

@BewareMyPower we can continue on slack

@eolivelli eolivelli deleted the fix/powermock-mockito-jdk11 branch March 17, 2021 06:49
@BewareMyPower
Copy link
Contributor

Thanks for you advice. I found the real cause just now, which is not related to this profile. The error may be caused by some Maven plugins, see https://youtrack.jetbrains.com/issue/IDEA-258574

I just fixed it by disabling the argLine option.

image

eolivelli added a commit to datastax/pulsar that referenced this pull request May 10, 2021
When you are running tests on JDK11 you encounter a lot of issues.
This patch includes a list of minor fixes that can be grouped.

Master issue apache#9578

- Upgrade Mockito to latest version
- Add  "--add-opens java.base/jdk.internal.loader=ALL-UNNAMED" in order to allow PowerMock to work
- add JAXB into jcloud provider (we already have it on the classpath in production, it is only in order to let tests run)
- Upgrade HDFS minicluster to 3.3.0
- Pin netty-codec-http dependency to the same version of netty (inherited from HDFS client)
- Use the same version of Jetty for hdfs-offload (old version does not work with JDK11)
eolivelli added a commit to datastax/pulsar that referenced this pull request May 11, 2021
When you are running tests on JDK11 you encounter a lot of issues.
This patch includes a list of minor fixes that can be grouped.

Master issue apache#9578

- Upgrade Mockito to latest version
- Add  "--add-opens java.base/jdk.internal.loader=ALL-UNNAMED" in order to allow PowerMock to work
- add JAXB into jcloud provider (we already have it on the classpath in production, it is only in order to let tests run)
- Upgrade HDFS minicluster to 3.3.0
- Pin netty-codec-http dependency to the same version of netty (inherited from HDFS client)
- Use the same version of Jetty for hdfs-offload (old version does not work with JDK11)
eolivelli added a commit to datastax/pulsar that referenced this pull request May 20, 2021
    ### Motivation
    When you are running tests on JDK11 you encounter a lot of issues.
    This patch includes a list of minor fixes that can be grouped.

    Master issue apache#9578

    ### Modifications
    - Upgrade Mockito to latest version
    - Add  "--add-opens java.base/jdk.internal.loader=ALL-UNNAMED" in order to allow PowerMock to work
    - add JAXB into jcloud provider (we already have it on the classpath in production, it is only in order to let tests run)
    - Upgrade HDFS minicluster to 3.3.0
    - Pin netty-codec-http dependency to the same version of netty (inherited from HDFS client)
    - Use the same version of Jetty for hdfs-offload (old version does not work with JDK11)

cherry picked manually from c94d782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants