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

Build failure on arch with openjdk 11.0.11 #1748

Closed
jemag opened this issue Apr 28, 2021 · 11 comments · Fixed by #1751
Closed

Build failure on arch with openjdk 11.0.11 #1748

jemag opened this issue Apr 28, 2021 · 11 comments · Fixed by #1751
Assignees
Milestone

Comments

@jemag
Copy link

jemag commented Apr 28, 2021

Seems like some tests are failing.
This happens on 2 of my computers, both using Arch Linux with same openjdk version. Note that the build was previously working when initially ran a couple weeks ago.

Details

Output from ./mvnw -version

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /home/jemag/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.11, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.11.16-arch1-1", arch: "amd64", family: "unix"

Full output from running ./mvnw clean verify -e -l build-output.txt
build-output.txt

Interesting pieces from output:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/jemag/dev/eclipse/eclipse.jdt.ls/org.eclipse.jdt.ls.tests/target/workingProjects/gradle/multi-module/build.gradle' line: 7

* What went wrong:
A problem occurred evaluating root project 'multi-module'.
> Plugin with id 'maven' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 139ms
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.083 s <<< FAILURE! - in org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest
testImportMixedProjects(org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest)  Time elapsed: 0.334 s
testImportNewGradleProjects(org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest)  Time elapsed: 0.317 s  <<< FAILURE!
java.lang.AssertionError: expected:<4> but was:<2>
	at org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest.testImportNewGradleProjects(ImportNewProjectsTest.java:131)

and at the end of it all:

Results:

Failures: 
  ImportNewProjectsTest.testImportNewGradleProjects:131 expected:<4> but was:<2>
Errors: 
  InvisibleProjectImporterTest.automaticJarDetectionLibUnderSource:110 » NullPointer

Tests run: 1339, Failures: 1, Errors: 1, Skipped: 12

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for JDT Language Server :: Parent 1.1.0-SNAPSHOT:
[INFO] 
[INFO] JDT Language Server :: Parent ...................... SUCCESS [  0.040 s]
[INFO] JDT Language Server :: Target Platform ............. SUCCESS [  0.079 s]
[INFO] JDT Language Server :: Core ........................ SUCCESS [ 23.768 s]
[INFO] JDT Language Server :: Tests ....................... FAILURE [05:46 min]
[INFO] JDT Language Server :: SyntaxServer Tests .......... SKIPPED
[INFO] JDT Language Server :: Product ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  06:17 min
[INFO] Finished at: 2021-04-28T10:54:19-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:2.3.0:test (default-test) on project org.eclipse.jdt.ls.tests: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/jemag/dev/eclipse/eclipse.jdt.ls/org.eclipse.jdt.ls.tests/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :org.eclipse.jdt.ls.tests
@snjeza
Copy link
Contributor

snjeza commented Apr 30, 2021

@jemag could you try #1751

# cd <eclipse.jdt.ls>
git fetch origin pull/1751/head:issue-1751 
git checkout issue-1751
./mvnw clean verify

@jemag
Copy link
Author

jemag commented Apr 30, 2021

@snjeza Thank you for the followup. I tried it, and I am still getting a build failure although the reason seems different this time:
here is the failure within the output:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/jemag/dev/eclipse/eclipse.jdt.ls/org.eclipse.jdt.ls.tests/target/workingProjects/gradle/multi-module/server/build.gradle' line: 2

* What went wrong:
A problem occurred evaluating project ':server'.
> Could not find method compile() for arguments [DefaultProjectDependency{dependencyProject='project ':client'', configuration='default'}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 43ms
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.005 s <<< FAILURE! - in org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest
testImportMixedProjects(org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest)  Time elapsed: 0.332 s
testImportNewGradleProjects(org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest)  Time elapsed: 0.219 s  <<< FAILURE!
java.lang.AssertionError: expected:<4> but was:<2>
	at org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest.testImportNewGradleProjects(ImportNewProjectsTest.java:131)

And here is the full output:
build-output-1751.txt

@snjeza
Copy link
Contributor

snjeza commented Apr 30, 2021

@jemag could you try the following:

unset GRADLE_HOME
./mvnw clean verify

@jemag
Copy link
Author

jemag commented Apr 30, 2021

 @snjeza it does seem to build successfully now with the GRADLE_HOME unset. I am a bit perplexed by that, shouldn't the gradle wrappers prevent such problems?

@snjeza
Copy link
Contributor

snjeza commented May 1, 2021

The multi-module project doesn't use any gradle wrappers.
Your GRADLE_HOME includes some older version of gradle.

@jemag
Copy link
Author

jemag commented May 1, 2021

I doubt this is an issue of me having an older version of gradle.
This is my only gradle and my GRADLE_HOME

 echo $GRADLE_HOME
/usr/share/java/gradle
 which gradle
/usr/bin/gradle
la /usr/bin/gradle
lrwxrwxrwx 33 root root 26 Apr 17:39 /usr/bin/gradle -> /usr/share/java/gradle/bin/gradle

Content of GRADLE_HOME/bin

 la $GRADLE_HOME/bin
.rwxr-xr-x 5.8k root root 26 Apr 17:39 gradle

and finally its version:
image

I am simply using the default gradle package from arch repo:

 sudo pacman -Qi gradle
[sudo] password for jemag:
Name            : gradle
Version         : 7.0-1
Description     : Powerful build system for the JVM
Architecture    : any
URL             : https://gradle.org/
Licenses        : Apache
Groups          : None
Provides        : None
Depends On      : java-environment  bash
Optional Deps   : gradle-doc: gradle documentation
                  gradle-src: gradle sources
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 121.40 MiB
Packager        : Levente Polyak <[email protected]>
Build Date      : Mon 26 Apr 2021 05:39:32 PM EDT
Install Date    : Tue 27 Apr 2021 03:26:26 PM EDT
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

@jemag
Copy link
Author

jemag commented May 1, 2021

I can also replicate the issue with this terrible Dockerfile:

FROM archlinux:latest
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm jdk11-openjdk git which maven gradle
RUN pacman -Qi gradle
RUN git clone "https://github.com/eclipse/eclipse.jdt.ls"
WORKDIR /eclipse.jdt.ls
RUN ls
CMD sleep 9999999

Building it:
docker build --no-cache -t eclipse .
Running it in background
docker run -d eclipse
Exec into it
docker exec -it 7bf2e sh -l
NOTE: sh -l is important because the GRADLE_HOME is set by a script within /etc/profile.d/ and it won't be loaded otherwise as sh won't be considered as login shell

Verifying that GRADLE_HOME is properly set
echo $GRADLE_HOME
Building it
./mvnw clean verify

Bug is still there and output is similar:
build-output-with-gradle-home.txt

@snjeza snjeza self-assigned this May 1, 2021
@snjeza
Copy link
Contributor

snjeza commented May 1, 2021

@jemag I have updated #1751
Could you, please, check again - #1748 (comment)

@jemag
Copy link
Author

jemag commented May 1, 2021

@snjeza seems to build properly with the added gradle wrapper from your PR

@rgrunber rgrunber added this to the Early May 2021 milestone May 4, 2021
@rgrunber
Copy link
Contributor

rgrunber commented May 4, 2021

FWIW, you can also test a bit quicker by adding : -DfailIfNoTests=false -DtestClass=org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest if the failure is independent of other tests. See https://www.eclipse.org/tycho/sitedocs/tycho-surefire-plugin/test-mojo.html#testClass .

@snjeza
Copy link
Contributor

snjeza commented May 4, 2021

FWIW, you can also test a bit quicker by adding : -DfailIfNoTests=false -DtestClass=org.eclipse.jdt.ls.core.internal.handlers.ImportNewProjectsTest if the failure is independent of other tests. See https://www.eclipse.org/tycho/sitedocs/tycho-surefire-plugin/test-mojo.html#testClass .

I'm checking #1756

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

Successfully merging a pull request may close this issue.

3 participants