[
https://issues.apache.org/jira/browse/CASSANDRA-16621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381547#comment-17381547
]
Andres de la Peña commented on CASSANDRA-16621:
-----------------------------------------------
Actually, maybe Fibonacci polling might not be such a good fit for us. Unless
I'm missing something, Awaitabilty doesn't try to check the condition right
before timing out. For example, if we have a timeout of 10000ms, the last
polling will be done at 6765ms, and there won't be any further polling until
10946ms, when the waiting will have already timed out. So, the intended timeout
of 10000ms will be actually become a timeout of 6765ms, which is significantly
shorter. Another example, this produces a possibly surprising timeout:
{code:java}
long start = System.currentTimeMillis();
Awaitility.await()
.pollInterval(fibonacci(TimeUnit.MILLISECONDS))
.atMost(10000, TimeUnit.MILLISECONDS)
.until(() -> System.currentTimeMillis() - start >= 7000);
{code}
Unless there is a way to check the condition right before the timeout, I think
it would be less surprising for the users of {{spinAssertEquals}} to just use a
fixed poll interval of ~100ms. wdyt?
> Replace spinAsserts code with Awaitility code
> ---------------------------------------------
>
> Key: CASSANDRA-16621
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16621
> Project: Cassandra
> Issue Type: Bug
> Components: Test/unit
> Reporter: Berenguer Blasi
> Assignee: Jogesh Anand
> Priority: Normal
> Labels: low-hanging-fruit
> Fix For: 4.0.x
>
>
> Currently spinAsserts does a similar thing to Awaitility which is being used
> more and more. We have now 2 ways of doing the same thing so it would be good
> to consolidate
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]