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

Tests fail after quarkus:dev run #7581

Closed
emmanuelbernard opened this issue Mar 4, 2020 · 11 comments · Fixed by #7584
Closed

Tests fail after quarkus:dev run #7581

emmanuelbernard opened this issue Mar 4, 2020 · 11 comments · Fixed by #7584
Assignees
Labels
area/core kind/bug Something isn't working
Milestone

Comments

@emmanuelbernard
Copy link
Member

When running mvn package (no clean) after quarkus:dev, 1. tests fail 2. with a weird inlined exception in the console.

# build Quarkus master
./mvn clean install -DskipTests

# create new project
cd /tmp
mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create -DprojectGroupId=org.acme -DprojectArtifactId=test -DclassName="org.acme.GreetingResource" -Dpath="/greeting"   -DplatformArtifactId=quarkus-bom -DplatformVersion=999-SNAPSHOT

# run quarkus:dev
cd test
./mvn clean compile quarkus:dev

# CTRL+C
# start package
./mvnw package
^[[A^[[A ~  Dow  nob  banner-test  mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< org.acme:banner-test >------------------------
[INFO] Building banner-test 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ banner-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ banner-test ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ banner-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/emmanuel/Downloads/nobackup/banner-test/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ banner-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/emmanuel/Downloads/nobackup/banner-test/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ banner-test ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.GreetingResourceTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.28 s <<< FAILURE! - in org.acme.GreetingResourceTest
[ERROR] testHelloEndpoint  Time elapsed: 0.011 s  <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigSourceProvider: io.quarkus.test.common.http.TestHTTPConfigSourceProvider not a subtype
Caused by: java.lang.RuntimeException: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigSourceProvider: io.quarkus.test.common.http.TestHTTPConfigSourceProvider not a subtype
Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigSourceProvider: io.quarkus.test.common.http.TestHTTPConfigSourceProvider not a subtype

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   GreetingResourceTest.testHelloEndpoint » Runtime java.lang.RuntimeException: j...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.166 s
[INFO] Finished at: 2020-03-04T21:19:05+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project banner-test: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/emmanuel/Downloads/nobackup/banner-test/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[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

If ./mvnw clean package is run, then no failure occurs.

@emmanuelbernard emmanuelbernard added the kind/bug Something isn't working label Mar 4, 2020
@emmanuelbernard
Copy link
Member Author

@gastaldi do you mind looking at it.
If you can't @stuartwdouglas can you check it out. Looks like a classloader related issue.

@maxandersen maxandersen added this to the 1.3.0 milestone Mar 4, 2020
@maxandersen
Copy link
Member

maxandersen commented Mar 4, 2020

I can reproduce this and does look like a blocker to me IMO.

@gsmet
Copy link
Member

gsmet commented Mar 4, 2020

/cc @dmlloyd

@gastaldi
Copy link
Contributor

gastaldi commented Mar 4, 2020

@aloubyansky this looks similar to the error we had in Gradle, no?

@gastaldi
Copy link
Contributor

gastaldi commented Mar 4, 2020

@stuartwdouglas assigning it to you, as I got zero cycles today :(

@aloubyansky
Copy link
Member

This is due to the classpath caching. Both quarkus:dev and test create the deployment classpath cache unless it already exists in the target dir. Except that it appears to be different for the dev and test. So if the dev ran first it will be missing the test deps. I guess it's a regression. I may be wrong but I think the deployment classpath previously shouldn't have contained the test deps.

@aloubyansky
Copy link
Member

aloubyansky commented Mar 4, 2020

Ah, of course, it's because now the whole app model is persisted instead of the deployment only part. The file name deployment.cp didn't change though.

@aloubyansky
Copy link
Member

I wouldn't classify this as a blocker for the CR though.

@emmanuelbernard
Copy link
Member Author

So we could either find a way to unify the work or segregate the cache for the two use cases (or three if we consider packaging as one).

@aloubyansky
Copy link
Member

Actually, changing the file name by appending the launch mode to it would be a one line fix. Let me see if I can do that now.

@gastaldi
Copy link
Contributor

gastaldi commented Mar 5, 2020

@aloubyansky hero! Fix merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants