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

Error in test execution #472

Closed
vtroliveira opened this issue Oct 16, 2017 · 8 comments
Closed

Error in test execution #472

vtroliveira opened this issue Oct 16, 2017 · 8 comments

Comments

@vtroliveira
Copy link

I'm trying to execute the test containers inside an web application deployed on glassfish
My test call is

public Result run(Test test) {
this.test = test;
logger.info("Running test {}", test.getTestName());
JUnitCore runner = new JUnitCore();
Result result = runner.run(TestBrowser.class);
logger.info("{} run complete", test.getTestName());
logger.info("It was successfull test? {}", result.wasSuccessful());
return result;
}

When I run this I got the exception above
Informações: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector; at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:57) at org.rnorth.ducttape.timeouts.Timeouts.getWithTimeout(Timeouts.java:32) at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:38) at org.testcontainers.containers.BrowserWebDriverContainer.containerIsStarted(BrowserWebDriverContainer.java:166) at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:238) at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:184) at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76) at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:182) at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:544) at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29) at org.junit.rules.RunRules.evaluate(RunRules.java:20)

In maven test scope it works perfectly, but this test works before on glassfish. Can anyone help me?

@rnorth
Copy link
Member

rnorth commented Oct 16, 2017

I think this is a dependency version conflict - probably two versions of Guava conflicting. Please could you try checking whether Maven is overriding any deps at build time (mvn dependency:analyze, I think)?

@bsideup
Copy link
Member

bsideup commented Nov 6, 2017

@rnorth aren't we shade Guava?

@iNikem
Copy link
Contributor

iNikem commented Feb 20, 2018

I have similar/same issue:

    2018-02-20 22:01:49.692  INFO   --- [    Test worker] o.t.containers.SeleniumUtils             : Selenium API version 3.8.1 detected on classpath
    2018-02-20 22:01:49.859  INFO   --- [    Test worker] ?.8.1]                                   : Pulling docker image: selenium/standalone-chrome-debug:3.8.1. Please be patient; this may take some time but only needs to be done once.
    2018-02-20 22:03:41.870  INFO   --- [    Test worker] ?.8.1]                                   : Creating container for image: selenium/standalone-chrome-debug:3.8.1
    2018-02-20 22:03:41.999  INFO   --- [    Test worker] ?.8.1]                                   : Starting container with ID: 7f1a5028e94d82f1303aa65ce041966711408c55e9fdc692fda5e3841a00a250
    2018-02-20 22:03:42.425  INFO   --- [    Test worker] ?.8.1]                                   : Container selenium/standalone-chrome-debug:3.8.1 is starting: 7f1a5028e94d82f1303aa65ce041966711408c55e9fdc692fda5e3841a00a250
    2018-02-20 22:03:42.851  INFO   --- [    Test worker] ?.8.1]                                   : Container selenium/standalone-chrome-debug:3.8.1 started
    2018-02-20 22:03:42.854  INFO   --- [    Test worker] 🐳 [richnorth/vnc-recorder:latest]       : Creating container for image: richnorth/vnc-recorder:latest
    2018-02-20 22:03:44.142  INFO   --- [    Test worker] 🐳 [richnorth/vnc-recorder:latest]       : Starting container with ID: 7d1bf316ce10e35f1dffcd6e3483e5246bd5223a04e7de85499e8ae0652a1242
    2018-02-20 22:03:44.594  INFO   --- [    Test worker] 🐳 [richnorth/vnc-recorder:latest]       : Container richnorth/vnc-recorder:latest is starting: 7d1bf316ce10e35f1dffcd6e3483e5246bd5223a04e7de85499e8ae0652a1242
    2018-02-20 22:03:44.602  INFO   --- [    Test worker] 🐳 [richnorth/vnc-recorder:latest]       : Container richnorth/vnc-recorder:latest started
    2018-02-20 22:03:44.967 ERROR   --- [    Test worker] ?.8.1]                                   : Could not start container

    java.lang.RuntimeException: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(Ljava/util/Comparator;)Ljava/util/stream/Collector;
        at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:57)
        at org.rnorth.ducttape.timeouts.Timeouts.getWithTimeout(Timeouts.java:32)
        at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:38)
        at org.testcontainers.containers.BrowserWebDriverContainer.containerIsStarted(BrowserWebDriverContainer.java:166)
        at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:246)
        at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:194)
        at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
        at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:192)
        at eu.plumbr.dashboard.BaseTest.<clinit>(BaseTest.groovy:68)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
        at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:380)
        at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:293)
        at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:115)
        at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:200)
        at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:120)
        at org.testng.TestRunner.initMethods(TestRunner.java:409)
        at org.testng.TestRunner.init(TestRunner.java:235)
        at org.testng.TestRunner.init(TestRunner.java:205)
        at org.testng.TestRunner.<init>(TestRunner.java:153)
        at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:536)
        at org.testng.SuiteRunner.init(SuiteRunner.java:159)
        at org.testng.SuiteRunner.<init>(SuiteRunner.java:113)
        at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
        at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
        at org.testng.TestNG.run(TestNG.java:1057)
        at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:129)
        at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:88)
        at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy1.stop(Unknown Source)
        at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:119)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(Ljava/util/Comparator;)Ljava/util/stream/Collector;
        at org.openqa.selenium.remote.NewSessionPayload.lambda$validate$4(NewSessionPayload.java:199)
        at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:372)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:373)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
        at org.openqa.selenium.remote.NewSessionPayload.validate(NewSessionPayload.java:215)
        at org.openqa.selenium.remote.NewSessionPayload.<init>(NewSessionPayload.java:163)
        at org.openqa.selenium.remote.NewSessionPayload.create(NewSessionPayload.java:114)
        at org.openqa.selenium.remote.NewSessionPayload.create(NewSessionPayload.java:107)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:155)
        at org.testcontainers.containers.BrowserWebDriverContainer.lambda$null$0(BrowserWebDriverContainer.java:169)
        at org.rnorth.ducttape.unreliables.Unreliables.lambda$retryUntilSuccess$0(Unreliables.java:41)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        ... 1 common frames omitted

Any hints, @bsideup @rnorth ?

@iNikem
Copy link
Contributor

iNikem commented Feb 21, 2018

Ou, disregard my comment. I myself had wrong guava dependency :)

@bsideup
Copy link
Member

bsideup commented Feb 21, 2018

@iNikem Actually, we should shade Guava in @rnorth's ducttape library to avoid that in future :)

@iNikem
Copy link
Contributor

iNikem commented Feb 21, 2018

But here the problem lies not in your code, but in Selenium's, not? It calls guava code and I had too old version of that.

@stale
Copy link

stale bot commented Oct 28, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@stale stale bot added the stale label Oct 28, 2018
@stale
Copy link

stale bot commented Nov 11, 2018

This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case.

@stale stale bot closed this as completed Nov 11, 2018
rnorth pushed a commit that referenced this issue Dec 24, 2018
Bumps [influxdb-java](https://github.com/influxdata/influxdb-java) from 2.10 to 2.14.
<details>
<summary>Changelog</summary>

*Sourced from [influxdb-java's changelog](https://github.com/influxdata/influxdb-java/blob/master/CHANGELOG.md).*

> ## 2.14 [2018-10-12]
> 
> ### Fixes
> 
> - Fixed chunked query exception handling [Issue #523](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/523)
> - Memory leak in StringBuilder cache for Point.lineprotocol() [Issue #526](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/521)
> 
> ## 2.13 [2018-09-12]
> 
> ### Fixes
> - MessagePack queries: Exception during parsing InfluxDB version [macOS] [PR #487](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/487)
> - The InfluxDBResultMapper is able to handle results with a different time precision [PR #501](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/501)
> - UDP target host address is cached [PR #502](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/502)
> - Error messages from server not parsed correctly when using msgpack [PR #506](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/506)
> - Response body must be closed properly in case of JSON response [PR #514](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/514)
> - Time is serialized not consistently in MsgPack and Json, missing millis and nanos in MsgPack[PR #517](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/517)
> 
> ### Features
> 
> - Support for Basic Authentication [PR #492](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/492)
> - Added possibility to reuse client as a core part of [influxdb-java-reactive](https://github.com/bonitoo-io/influxdb-java-reactive) client [PR #493](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/493)
> - Retry capability for writing of BatchPoints [PR #503](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/503)
> - Added `BiConsumer` with capability to discontinue a streaming query [Issue #515](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/515)
> - Added `onComplete` action that is invoked after successfully end of streaming query [Issue #515](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/515)
> 
> ## 2.12 [2018-07-31]
> 
> ### Fixes
> 
> - Remove code which checks for unsupported influxdb versions [PR #474](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/474)
> - Unpredictable errors when OkHttpClient.Builder instance is reused [PR #478](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/478)
> 
> ### Features
> 
> - Support for MessagePack [PR #471](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/471)
> - Cache version per influxdb instance and reduce ping() calls for every query call [PR #472](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/472)
> - FAQ list for influxdb-java [PR #475](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/475)
> 
> ### Improvements
> 
> - Test: Unit test to ensure tags should be sorted by key in line protocol (to reduce db server overheads) [PR #476](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/476)
> 
> ## 2.11 [2018-07-02]
> 
> ### Features
> 
> - Allow write precision of TimeUnit other than Nanoseconds [PR #321](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/321)
> - Support dynamic measurement name in InfluxDBResultMapper [PR #423](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/423)
> - Debug mode which allows HTTP requests being sent to the database to be logged [PR #450](https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/450)
> - Fix problem of connecting to the influx api with URL which does not points to the url root (e.g. localhots:80/influx-api/) [PR #400] (https://github-redirect.dependabot.com/influxdata/influxdb-java/pull/400)
></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`91d0f09`](influxdata/influxdb-java@91d0f09) [maven-release-plugin] prepare release influxdb-java-2.14
- [`8ffaeb9`](influxdata/influxdb-java@8ffaeb9) Revert "[maven-release-plugin] prepare release influxdb-java-2.14"
- [`2781da2`](influxdata/influxdb-java@2781da2) [maven-release-plugin] prepare release influxdb-java-2.14
- [`19c69ed`](influxdata/influxdb-java@19c69ed) [maven-release-plugin] prepare for next development iteration
- [`c6d7f25`](influxdata/influxdb-java@c6d7f25) [maven-release-plugin] prepare release influxdb-java-2.14
- [`2f4c594`](influxdata/influxdb-java@2f4c594) Merge pull request [#531](https://github-redirect.dependabot.com/influxdata/influxdb-java/issues/531) from heshengbang/master
- [`f653e62`](influxdata/influxdb-java@f653e62) Easy to use try-with-resources, add README.md
- [`c7be9b0`](influxdata/influxdb-java@c7be9b0) Easy to use try-with-resources
- [`4590d18`](influxdata/influxdb-java@4590d18) - added automated SNAPSHOT publishing to Maven Central repository
- [`ce65a41`](influxdata/influxdb-java@ce65a41) - added automated SNAPSHOT publishing to Maven Central repository
- Additional commits viewable in [compare view](influxdata/influxdb-java@influxdb-java-2.10...influxdb-java-2.14)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=org.influxdb:influxdb-java&package-manager=gradle&previous-version=2.10&new-version=2.14)](https://dependabot.com/compatibility-score.html?dependency-name=org.influxdb:influxdb-java&package-manager=gradle&previous-version=2.10&new-version=2.14)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in the `.dependabot/config.yml` file in this repo:
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

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

No branches or pull requests

4 participants