[ 
https://issues.apache.org/jira/browse/IGNITE-6430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449829#comment-16449829
 ] 

Alexander Menshikov commented on IGNITE-6430:
---------------------------------------------

[~agura]
I have tried to reproduce the bug locally.
It fails for me on another line:
{code:java}
assertTrue(finishTime > 0);
{code}

It can be fixed by code similar to the code above in the same test, like that:

{code:java}
waitForCondition(new PA() {
            @Override public boolean apply() {
                return 
ig2.cache(CACHE1).localMetrics().getEstimatedRebalancingFinishTime() != -1L;
            }
        }, 5_000);

long finishTime = 
ig2.cache(CACHE1).localMetrics().getEstimatedRebalancingFinishTime();
assertTrue(finishTime > 0);
{code}

With this fix, the test works fine for me.

Also, if we look to a calculation of *getEstimatedRebalancingFinishTime* (in 
class *CacheMetricsImpl*), we will see it equals to:

{code:java}
((getKeysToRebalanceLeft() / rate) * REBALANCE_RATE_INTERVAL) + 
U.currentTimeMillis();
{code}

Where rate > 0, getKeysToRebalanceLeft >= 0, and REBALANCE_RATE_INTERVAL > 0.

> CacheGroupsMetricsRebalanceTest.testRebalanceEstimateFinishTime test fails 
> periodically.
> ----------------------------------------------------------------------------------------
>
>                 Key: IGNITE-6430
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6430
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Andrey Gura
>            Assignee: Alexander Menshikov
>            Priority: Major
>              Labels: MakeTeamcityGreenAgain
>
> {{CacheGroupsMetricsRebalanceTest.testRebalanceEstimateFinishTime}} test 
> fails periodically.
> {noformat}
> [2017-09-18 15:18:20,073][ERROR][main][root] Test failed.
> junit.framework.AssertionFailedError: Expected less 5000, Actual:-100969
>     at junit.framework.Assert.fail(Assert.java:57)
>     at junit.framework.Assert.assertTrue(Assert.java:22)
>     at junit.framework.TestCase.assertTrue(TestCase.java:192)
>     at 
> org.apache.ignite.internal.processors.cache.CacheGroupsMetricsRebalanceTest.testRebalanceEstimateFinishTime(CacheGroupsMetricsRebalanceTest.java:261)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at junit.framework.TestCase.runTest(TestCase.java:176)
>     at 
> org.apache.ignite.testframework.junits.GridAbstractTest.runTestInternal(GridAbstractTest.java:2000)
>     at 
> org.apache.ignite.testframework.junits.GridAbstractTest.access$000(GridAbstractTest.java:132)
>     at 
> org.apache.ignite.testframework.junits.GridAbstractTest$5.run(GridAbstractTest.java:1915)
>     at java.lang.Thread.run(Thread.java:745)
> {noformat}
> After fix test should be unmuted on TC.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to