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

Yifan Cai commented on CASSANDRA-15308:
---------------------------------------

I got your concern. It was probably mainly that I failed to explain it clearly. 
IMO, only the test was wrong for not cleaning up the remaining in the 
{{global}} and the same {{global}} is referenced in the next run. The 
{{global}} was supposed to be shared. So the implementation looked good to me. 
Just the test was wrong.
{quote}Is there a reason you don't simply release all remaining capacity, as 
opposed to looping releasing acquireStep?
{quote}
There is no API from {{OutboundConnection}} to release all remaining capacity. 
I do not feel like to add one more method just for testing purpose. Therefore, 
it uses the existing one and release the capacity by looping.

There is one potential place that can release all remaining capacity in the 
{{ConnectionTest#doTestManual}} by releasing the {{reserveCapacityInBytes}}. 
But I think it is more proper to clean up the remaining capacity in the test 
itself. Because only {{testAcquireReleaseOutbound}} tests the contention 
scenario by explicitly acquiring and releasing capacity.

> Fix flakey testAcquireReleaseOutbound - 
> org.apache.cassandra.net.ConnectionTest
> -------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-15308
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15308
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: Joey Lynch
>            Assignee: Yifan Cai
>            Priority: Normal
>             Fix For: 4.0-alpha
>
>
> Example failure: 
> https://circleci.com/gh/jolynch/cassandra/554#tests/containers/61
> {noformat}
> Your job ran 4428 tests with 1 failure
> - testAcquireReleaseOutbound - org.apache.cassandra.net.ConnectionTest
> junit.framework.AssertionFailedError
>       at 
> org.apache.cassandra.net.ConnectionTest.lambda$testAcquireReleaseOutbound$53(ConnectionTest.java:770)
>       at 
> org.apache.cassandra.net.ConnectionTest.lambda$doTest$8(ConnectionTest.java:238)
>       at 
> org.apache.cassandra.net.ConnectionTest.doTestManual(ConnectionTest.java:258)
>       at 
> org.apache.cassandra.net.ConnectionTest.doTest(ConnectionTest.java:236)
>       at org.apache.cassandra.net.ConnectionTest.test(ConnectionTest.java:225)
>       at 
> org.apache.cassandra.net.ConnectionTest.testAcquireReleaseOutbound(ConnectionTest.java:767)
>  {noformat}



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

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

Reply via email to