cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andres de la Peña (Jira) <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-16621) Replace spinAsserts code with Awaitility code
Date Mon, 19 Jul 2021 18:12:00 GMT

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

Andres de la Peña edited comment on CASSANDRA-16621 at 7/19/21, 6:11 PM:
-------------------------------------------------------------------------

I'm not totally sure about how the poll interval affects {{ThreadPoolMetricsTest.testJMXEnabledThreadPoolMetricsWithBlockedThread}},
but I think that [the failing assert|https://github.com/apache/cassandra/blob/a9abf5accb2265c6394bf8134dc5496c5505375c/test/unit/org/apache/cassandra/metrics/ThreadPoolMetricsTest.java#L162]
is wrong. The tasks {{task5}} and {{task6}} are asynchronously submitted to the the executor,
so they can be executed in any order. I think that the test should consider that they can
be submitted in any order, [this way|https://github.com/adelapena/cassandra/commit/4a47cb2f3e6267cd307d5ac907e8a45b9d6b8468].
As soon as we make this change the test seems to consistently pass independently of the poll
interval ([j8|https://app.circleci.com/pipelines/github/adelapena/cassandra/678/workflows/29642061-8a38-4c59-9e63-b1cb3f4d66eb/jobs/6885]
and [j11|https://app.circleci.com/pipelines/github/adelapena/cassandra/678/workflows/29642061-8a38-4c59-9e63-b1cb3f4d66eb/jobs/6883]). 

Also, as mentioned before, I think it could be useful to have an optimistic poll delay of
zero, independent of the poll interval, so tests like this one can have better execution times.
For example, {{ThreadPoolMetricsTest}} with a poll delay of zero and poll interval of 100
passes in less than half a second, while with only the poll interval it needs around five
seconds to finish.


was (Author: adelapena):
I'm not totally sure about how the poll interval affects {{ThreadPoolMetricsTest.testJMXEnabledThreadPoolMetricsWithBlockedThread}},
but I think that [the failing assert|https://github.com/apache/cassandra/blob/a9abf5accb2265c6394bf8134dc5496c5505375c/test/unit/org/apache/cassandra/metrics/ThreadPoolMetricsTest.java#L162]
is wrong. The tasks {{task5}} and {{task6}} and asynchronously submitted to the the executor,
so they can be executed in any order. I think that the test should consider that they can
be submitted in any order, [this way|https://github.com/adelapena/cassandra/commit/4a47cb2f3e6267cd307d5ac907e8a45b9d6b8468].
As soon as we make this change the test seems to consistently pass independently of the poll
interval ([j8|https://app.circleci.com/pipelines/github/adelapena/cassandra/678/workflows/29642061-8a38-4c59-9e63-b1cb3f4d66eb/jobs/6885]
and [j11|https://app.circleci.com/pipelines/github/adelapena/cassandra/678/workflows/29642061-8a38-4c59-9e63-b1cb3f4d66eb/jobs/6883]). 

Also, as mentioned before, I think it could be useful to have an optimistic poll delay of
zero, independent of the poll interval, so tests like this one can have better execution times.
For example, {{ThreadPoolMetricsTest}} with a poll delay of zero and poll interval of 100
passes in less than half a second, while with only the poll interval it needs around five
seconds to finish.

> 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: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message