You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jacek Lewandowski (Jira)" <ji...@apache.org> on 2021/04/09 07:31:00 UTC

[jira] [Commented] (CASSANDRA-16497) concurrent.LongSharedExecutorPoolTest.testPromptnessOfExecution broken

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

Jacek Lewandowski commented on CASSANDRA-16497:
-----------------------------------------------

I know what is broken in this test and I can fix it

There were two problems in this test. First is that what is called 'timeout' has a 'deadline'
semantics which means that it is a point in time rather than a duration. However in one place
it was used as a timeout, thus everything got confused at some point and the actual deadlines
turned out to be negative.

The other problem was that with some probability we choose a deadline as Long.MAX_VALUE.
After that, we call Future.get with the corresponding timeout - the timeout is calculated by
subtracting System.nanotime from our deadline (which is Long.MAX_VALUE). However, Future.get
internally adds back System.nanotime to the timeout and passed that to some internal method
await. The problem is that, between subtracting System.nanotime and adding it back, some
time elapses and the second call to System.nanotime returns a larger value, thus the deadline
calculated internally in Future.get overflows the long domain.

I can fix it if you like

> concurrent.LongSharedExecutorPoolTest.testPromptnessOfExecution broken
> ----------------------------------------------------------------------
>
>                 Key: CASSANDRA-16497
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16497
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: Adam Holmberg
>            Assignee: Michael Semb Wever
>            Priority: Normal
>             Fix For: 4.0-rc1, 4.0
>
>
> {noformat}
> junit.framework.AssertionFailedError
> 	at org.apache.cassandra.concurrent.LongSharedExecutorPoolTest.testPromptnessOfExecution(LongSharedExecutorPoolTest.java:169)
> 	at org.apache.cassandra.concurrent.LongSharedExecutorPoolTest.testPromptnessOfExecution(LongSharedExecutorPoolTest.java:102)
> {noformat}
> https://ci-cassandra.apache.org/job/Cassandra-trunk/308/testReport/org.apache.cassandra.concurrent/LongSharedExecutorPoolTest/testPromptnessOfExecution/



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org