allegro / hermes

Fast and reliable message broker built on top of Kafka.
http://hermes.allegro.tech
Other
819 stars 218 forks source link

Flaky test: ReadinessCheckTest. prepareEnvironment #1487

Closed pitagoras3 closed 1 year ago

pitagoras3 commented 2 years ago

It looks like sometimes ZooKeeper is not ready after 120 seconds (path /hermes/groups is not created).

Where it fails:

private void waitUntilStructureInZookeeperIsCreated(CuratorFramework zookeeper) {
    waitAtMost(adjust(120), TimeUnit.SECONDS).until(() -> zookeeper.checkExists().forPath("/hermes/groups") != null);
}

Error logs:

pl.allegro.tech.hermes.integration.ReadinessCheckTest.prepareEnvironment FAILED
    java.lang.RuntimeException: Exception during environment preparation
        at pl.allegro.tech.hermes.integration.env.HermesIntegrationEnvironment.prepareEnvironment(HermesIntegrationEnvironment.java:118)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
        at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:62)
        at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:385)
        at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:321)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:317)
        at org.testng.SuiteRunner.run(SuiteRunner.java:276)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1212)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1134)
        at org.testng.TestNG.runSuites(TestNG.java:1063)
        at org.testng.TestNG.run(TestNG.java:1031)
        at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:141)
        at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:90)
        at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
        at com.sun.proxy.$Proxy2.stop(Unknown Source)
        at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.base/java.lang.Thread.run(Thread.java:829)

        Caused by:
        java.lang.RuntimeException: com.jayway.awaitility.core.ConditionTimeoutException: Condition with lambda expression in pl.allegro.tech.hermes.integration.setup.HermesManagementInstance$Starter that uses org.apache.curator.framework.CuratorFramework was not fulfilled within 120 seconds.
            at pl.allegro.tech.hermes.integration.setup.HermesManagementInstance$Starter.start(HermesManagementInstance.java:88)
            at pl.allegro.tech.hermes.integration.env.HermesIntegrationEnvironment.prepareEnvironment(HermesIntegrationEnvironment.java:91)
            ... 44 more

            Caused by:
            com.jayway.awaitility.core.ConditionTimeoutException: Condition with lambda expression in pl.allegro.tech.hermes.integration.setup.HermesManagementInstance$Starter that uses org.apache.curator.framework.CuratorFramework was not fulfilled within 120 seconds.
                at com.jayway.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:93)
                at com.jayway.awaitility.core.CallableCondition.await(CallableCondition.java:73)
                at com.jayway.awaitility.core.CallableCondition.await(CallableCondition.java:25)
                at com.jayway.awaitility.core.ConditionFactory.until(ConditionFactory.java:590)
                at com.jayway.awaitility.core.ConditionFactory.until(ConditionFactory.java:582)
                at pl.allegro.tech.hermes.integration.setup.HermesManagementInstance$Starter.waitUntilStructureInZookeeperIsCreated(HermesManagementInstance.java:93)
                at pl.allegro.tech.hermes.integration.setup.HermesManagementInstance$Starter.start(HermesManagementInstance.java:84)
                ... 45 more
lshadown commented 2 years ago

@pitagoras3 Hi :), I can take care of it.