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

[GIB-TEST] Handle default package name when generating class names Fixes #13540 #13543

Closed

Conversation

maxandersen
Copy link
Member

** DO NOT MERGE **

this is a mirror of real PR going to master - but this one is just testing against GIB as
discussed in #13243

@ghost
Copy link

ghost commented Nov 29, 2020

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

This message is automatically generated by a bot.

@ghost ghost added area/arc Issue related to ARC (dependency injection) area/qute The template engine area/scheduler area/vertx labels Nov 29, 2020
@maxandersen maxandersen marked this pull request as ready for review November 29, 2020 22:27
@maxandersen
Copy link
Member Author

so interesting part here is that the mirrored PR at #13541 passed its tests in 4h23m where as this ran (but failed) in 3h01m.

@famod you want to investigate ?

@famod
Copy link
Member

famod commented Nov 30, 2020

First off thanks for taking on this task!

I had a look at JVM Tests - JDK 11 and the problem here is this:

2020-11-30T01:10:37.7856306Z [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 6.603 s <<< FAILURE! - in io.quarkus.it.elasticsearch.FruitResourceTest
2020-11-30T01:10:37.7891330Z [ERROR] io.quarkus.it.elasticsearch.FruitResourceTest.testEndpoint  Time elapsed: 0.008 s  <<< ERROR!
2020-11-30T01:10:37.7897490Z java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: io.quarkus.runner.bootstrap.AugmentActionImpl.<init>(io.quarkus.bootstrap.app.CuratedApplication, java.util.List)

That constructor hasn't been touched for a year. And even more strangely: The module containing this class (quarkus-core-deployment) is built in this very job.

I found one place where this jar is overwritten:

2020-11-30T00:35:13.0983183Z [INFO] --- maven-invoker-plugin:3.1.0:install (integration-tests) @ quarkus-integration-test-container-image-invoker ---
2020-11-30T00:35:13.3903841Z [INFO] Installing /home/runner/work/quarkus/quarkus/core/deployment/pom.xml to /home/runner/.m2/repository/io/quarkus/quarkus-core-deployment/999-SNAPSHOT/quarkus-core-deployment-999-SNAPSHOT.pom
2020-11-30T00:35:13.4004678Z [INFO] Installing /home/runner/work/quarkus/quarkus/core/deployment/target/quarkus-core-deployment-999-SNAPSHOT.jar to /home/runner/.m2/repository/io/quarkus/quarkus-core-deployment/999-SNAPSHOT/quarkus-core-deployment-999-SNAPSHOT.jar

While that's definitely something to fix (because Maven invoker tests should not operate on the "real" local Maven repo, IMHO), it does not explain the problem since it is merely re-installing the same jar that has been build before.

This is already the second strange "inconsistent jarfile" (so to say) in an integration test, the other one being a CCE in a micrometer-prometheus IT. In both cases many ITs before that failure are passing, so it does not seem to be a general problem?

@famod
Copy link
Member

famod commented Nov 30, 2020

@maxandersen until we have a clue what's the problem we could switch GIB to buildAll mode.
If you want to try that out you'd need to replace -Dgib.forceBuildModules=resteasy-reactive with -Dgib.buildAll in ci-actions.yml. This could either be done in gib-test or for more flexibility you could also create yet another branch, e.g. gib-test-buildall.

@maxandersen
Copy link
Member Author

@famod if you open prs against gib-test I'll happily merge them. Just mention me. This way I'm not making mistakes :)

@famod
Copy link
Member

famod commented Nov 30, 2020

Ok, might come up with PR then. But first I'm trying to reproduce it in my fork.

@famod
Copy link
Member

famod commented Nov 30, 2020

So this seems to fix the problem:
-Dgib.forceBuildModules='quarkus-core.*|resteasy-reactive'
but I don't know why core needs to be built. I mean it should just work as is from the local repo which is reused from the previous initial JDK11 job.

@aloubyansky do you have a clue?

@famod
Copy link
Member

famod commented Nov 30, 2020

@maxandersen

@famod if you open prs against gib-test I'll happily merge them.

I've just updated #13243 with -Dgib.forceBuildModules='quarkus-core.*|resteasy-reactive'.
So I think it's best to re-create gib-test? If you'd prefer a PR for gib-test instead just let me know.

@maxandersen
Copy link
Member Author

i've rebased gib-test and then this pr on new gibtest.

@famod
Copy link
Member

famod commented Nov 30, 2020

What the...

2020-11-30T23:16:06.1288576Z [ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 3.627 s <<< FAILURE! - in io.quarkus.it.elasticsearch.FruitResourceTest
2020-11-30T23:16:06.1295245Z [ERROR] io.quarkus.it.elasticsearch.FruitResourceTest.testEndpoint  Time elapsed: 0.014 s  <<< ERROR!
2020-11-30T23:16:06.1301007Z org.junit.jupiter.api.extension.TestInstantiationException: Failed to create test instance
[...]
2020-11-30T23:16:06.1955150Z Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
2020-11-30T23:16:06.1970557Z 	at io.quarkus.runner.bootstrap.RunningQuarkusApplicationImpl.instance(RunningQuarkusApplicationImpl.java:80)
2020-11-30T23:16:06.1973521Z 	at io.quarkus.test.junit.QuarkusTestExtension.initTestState(QuarkusTestExtension.java:676)
2020-11-30T23:16:06.1976177Z 	... 64 more
2020-11-30T23:16:06.1977947Z Caused by: java.lang.reflect.InvocationTargetException
2020-11-30T23:16:06.1980092Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2020-11-30T23:16:06.1982331Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2020-11-30T23:16:06.1984836Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2020-11-30T23:16:06.1986599Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2020-11-30T23:16:06.1988771Z 	at io.quarkus.runner.bootstrap.RunningQuarkusApplicationImpl.instance(RunningQuarkusApplicationImpl.java:75)
2020-11-30T23:16:06.1990392Z 	... 65 more
2020-11-30T23:16:06.1991100Z Caused by: java.lang.IllegalStateException: Unable to locate CDIProvider
2020-11-30T23:16:06.1992379Z 	at javax.enterprise.inject.spi.CDI.findAllProviders(CDI.java:121)
2020-11-30T23:16:06.1994350Z 	at javax.enterprise.inject.spi.CDI.getCDIProvider(CDI.java:82)
2020-11-30T23:16:06.1995626Z 	at javax.enterprise.inject.spi.CDI.current(CDI.java:64)
2020-11-30T23:16:06.1996340Z 	... 70 more

So same test, different error. I didn't get this error in my fork. 😞

@famod
Copy link
Member

famod commented Nov 30, 2020

2020-11-30T23:16:06.0904636Z 2020-11-30 23:16:05,979 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.elasticsearch.socket-timeout" was provided; it will be ignored; verify that the dependency extension for this configuration is set or you did not make a typo
2020-11-30T23:16:06.0907873Z 2020-11-30 23:16:05,979 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.elasticsearch.protocol" was provided; it will be ignored; verify that the dependency extension for this configuration is set or you did not make a typo
2020-11-30T23:16:06.0910466Z 2020-11-30 23:16:05,979 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.elasticsearch.hosts" was provided; it will be ignored; verify that the dependency extension for this configuration is set or you did not make a typo
2020-11-30T23:16:06.0913341Z 2020-11-30 23:16:05,980 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.elasticsearch.discovery.refresh-interval" was provided; it will be ignored; verify that the dependency extension for this configuration is set or you did not make a typo
2020-11-30T23:16:06.0916535Z 2020-11-30 23:16:05,980 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.elasticsearch.discovery.enabled" was provided; it will be ignored; verify that the dependency extension for this configuration is set or you did not make a typo
2020-11-30T23:16:06.0918306Z 2020-11-30 23:16:06,058 INFO  [io.quarkus] (main) Quarkus 999-SNAPSHOT on JVM started in 1.038s. 
2020-11-30T23:16:06.0919185Z 2020-11-30 23:16:06,059 INFO  [io.quarkus] (main) Profile test activated. 
2020-11-30T23:16:06.0920009Z 2020-11-30 23:16:06,061 INFO  [io.quarkus] (main) Installed features: []

So it finds/activates no features. How can this be?

@aloubyansky
Copy link
Member

All these stacktraces indicate that the classpath isn't complete for some reason.

@aloubyansky
Copy link
Member

That constructor hasn't been touched for a year. And even more strangely: The module containing this class (quarkus-core-deployment) is built in this very job.

I guess it can't locate the JAR that was built from the current workspace and pulls in an older version somehow.

@aloubyansky
Copy link
Member

-Dgib.forceBuildModules='quarkus-core.*|resteasy-reactive'

This one is probably "helping locate" the JAR built from the current workspace. Not sure how/why yet.

@famod
Copy link
Member

famod commented Dec 1, 2020

@aloubyansky Thanks for chiming in!

pulls in an older version somehow

But where can such an old outdated version even come from? I mean sure, there is a SNAPSHOT deployment but even if the job would pull such artifacts, they should not be that old.
And then again, the initial job has already built everything and uploaded it's local repo for further reuse by subsequent jobs...

This one is probably "helping locate" the JAR built from the current workspace

Workspace resolution only works for the modules that are part of the reactor. So when I force quarkus-core.* then all matching modules will be part of the reactor and their artifacts should thus be resolved from the current workspace/reactor.
But here is the thing: Everything that is not part of the reactor should be resolved from the local repo (that is reused from the initial job) and I don't see how this can be outdated.
Or maybe some Quarkus internals have issues with a mixture of workspace/reactor artifacts and artifacts from local repo?

@aloubyansky
Copy link
Member

pulls in an older version somehow

But where can such an old outdated version even come from? I mean sure, there is a SNAPSHOT deployment but even if the job would pull such artifacts, they should not be that old.

I don't have the answer, unfortunately. It might not be related at all but there is for example a test in the Maven IT module that is pulling it 1.3.3.Final quarkus-bom (not the core though). Perhaps we should check whether it has anything to do with it. Although, I don't see how.

And then again, the initial job has already built everything and uploaded it's local repo for further reuse by subsequent jobs...

If you remove that quarkus-core from force build modules, how reproducible would that be? I mean the resolution of the old version.

@famod
Copy link
Member

famod commented Dec 1, 2020

I didn't get this error in my fork. 😞

I stand corrected! I made a mistake while trying to mimic this PR in my fork.
I now do also get zero installed features in that test, resulting in IllegalStateException: Unable to locate CDIProvider.

@aloubyansky

If you remove that quarkus-core from force build modules, how reproducible would that be?

Should be reproducible, now that I've found my mistake (see above). Will try this next.

It might not be related at all but there is for example a test in the Maven IT module that is pulling it 1.3.3.Final quarkus-bom (not the core though).

Since Maven ITs run in a separate job, I don't think this is related.

Maybe I really should have a look at those container-image invoker tests that seem to mutate the local repo.

@famod
Copy link
Member

famod commented Dec 2, 2020

After rebasing and including #13218 (to close some gaps, just in case) and without any forceBuildModules, I am now getting a test failure a little earlier:

2020-12-02T01:38:46.4672476Z [INFO] Running io.quarkus.it.micrometer.mpmetrics.MPMetricsTest
2020-12-02T01:38:52.8133095Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-development-mode-spi/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8136764Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-development-mode-spi/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8140414Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-development-mode-spi/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8144401Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/arc/arc/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8147638Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/arc/arc/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8150262Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/arc/arc/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8154731Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-security-runtime-spi/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8158453Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-security-runtime-spi/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8161404Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-security-runtime-spi/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8164650Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-bootstrap-app-model/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8167553Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-bootstrap-app-model/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8169997Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-bootstrap-app-model/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8172883Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-bootstrap-maven-resolver/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8175888Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-bootstrap-maven-resolver/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8178684Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-bootstrap-maven-resolver/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8183624Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-bootstrap-gradle-resolver/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8187004Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-bootstrap-gradle-resolver/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8189859Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-bootstrap-gradle-resolver/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8193044Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-class-change-agent/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8196164Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-class-change-agent/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8198771Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-class-change-agent/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8201990Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-devtools-utilities/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8205105Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-devtools-utilities/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8207720Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-devtools-utilities/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8210649Z Downloading from google-maven-central: https://maven-central-eu.storage-download.googleapis.com/repos/central/data/io/quarkus/quarkus-builder/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8213727Z Downloading from jboss-maven-central-proxy: https://repository.jboss.org/nexus/content/repositories/central/io/quarkus/quarkus-builder/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8216103Z Downloading from gradle-official-repository: https://repo.gradle.org/gradle/libs-releases-local/io/quarkus/quarkus-builder/999-SNAPSHOT/maven-metadata.xml
2020-12-02T01:38:52.8585878Z [ERROR] Tests run: 7, Failures: 0, Errors: 1, Skipped: 6, Time elapsed: 6.388 s <<< FAILURE! - in io.quarkus.it.micrometer.mpmetrics.MPMetricsTest
2020-12-02T01:38:52.8588322Z [ERROR] io.quarkus.it.micrometer.mpmetrics.MPMetricsTest.callPrimeGen_1  Time elapsed: 0.018 s  <<< ERROR!
2020-12-02T01:38:52.8591212Z java.lang.RuntimeException: java.util.ServiceConfigurationError: io.smallrye.config.SmallRyeConfigFactory: io.quarkus.runtime.configuration.QuarkusConfigFactory not a subtype
2020-12-02T01:38:52.8595309Z 	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:564)
[...]
2020-12-02T01:38:52.8942686Z Caused by: java.util.ServiceConfigurationError: io.smallrye.config.SmallRyeConfigFactory: io.quarkus.runtime.configuration.QuarkusConfigFactory not a subtype
2020-12-02T01:38:52.8951801Z 	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
2020-12-02T01:38:52.8953414Z 	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1236)
2020-12-02T01:38:52.8955316Z 	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
2020-12-02T01:38:52.8956730Z 	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
2020-12-02T01:38:52.8957795Z 	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
2020-12-02T01:38:52.8959888Z 	at io.smallrye.config.SmallRyeConfigProviderResolver.getFactoryFor(SmallRyeConfigProviderResolver.java:110)
[...]

It looks as if classes are being loaded by the wrong classloader(s) (or maybe twice or whatever).

Maybe I really should have a look at those container-image invoker tests that seem to mutate the local repo.

Exclusion of those and the kubernetes invoker tests changes nothing, unfortunately.

@famod famod mentioned this pull request Dec 2, 2020
11 tasks
@aloubyansky
Copy link
Member

Is it still failing at different points on every run or is this a consistent outcome?

@famod
Copy link
Member

famod commented Dec 2, 2020

@aloubyansky I haven't yet tried to reproduce the "new" ServiceConfigurationError but the ServerSerializers failure is reproducible (originally spotted here: #13243 (comment)).
I am now trying to exclude all other ITs but I suppose this will not change anything.

PS, to clear things up a litte (or to make things more complex 😨):

These scenarios came up while testing in my fork. I thought it is better to remove forceBuildModules for now since there seems to be a pattern.

@famod
Copy link
Member

famod commented Dec 2, 2020

I am now trying to exclude all other ITs but I suppose this will not change anything.

Oh well, if only micrometer-prometheus is running its ITs and all other submodules of integrations-tests don't, then the ServerSerializers error does not occur! Tests in non IT modules are executed regardless.
So it seems there is a rogue IT somewhere?!

@famod
Copy link
Member

famod commented Dec 3, 2020

So it seems there is a rogue IT somewhere?!

Hot candidate: ide-launcher! Still verifying...

/cc @aloubyansky

@famod
Copy link
Member

famod commented Dec 3, 2020

It is ide-launcher but I don't know why this very simple integration test module is causing the problem.
The only "special" aspect I can see is that IDELauncherTestCase is not a @QuarkusTest (which makes sense).

@aloubyansky @stuartwdouglas any ideas?

@famod
Copy link
Member

famod commented Dec 3, 2020

FTR: If ide-launcher is removed from the build or is moved behind the micrometer ITs, all problems seem to vanish (the ServerSerializers problem from #13243 (comment) and the ServiceConfigurationError from this Test-PR).
This is without any forceBuildModules!

@aloubyansky and I still need to figure out what is happening exactly during IDELauncherTestCase in the incremental scenario, but we'll get there.

@famod
Copy link
Member

famod commented Dec 10, 2020

The ide-launcher / ServerSerializers problem will be fixed by #13815. 🎉
As soon as that PR is merged, I'll update the gitflow-incremental-builder branch and we can then "reboot" this test PR.

@famod
Copy link
Member

famod commented Feb 17, 2021

I don't think we need another iteration here, closing.

Thanks for your support @maxandersen!

@famod famod closed this Feb 17, 2021
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/qute The template engine area/scheduler area/vertx triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants