[
https://issues.apache.org/jira/browse/CASSANDRA-21056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18042452#comment-18042452
]
Dmitry Konstantinov edited comment on CASSANDRA-21056 at 12/3/25 10:47 AM:
---------------------------------------------------------------------------
It looks like org.apache.cassandra.metrics.ThreadLocalMeter#tickAll invoked by
background job can be a cause of the flakiness by introducing a non-determinism
in the test logic (it is triggered every 5 seconds and the test may run for ~7
seconds)
The error is reproduced by temporary adjusting the code to run the job more
frequently.
To avoid this flakiness I am going to add a logic to disable the background job
in the test
was (Author: dnk):
It looks like org.apache.cassandra.metrics.ThreadLocalMeter#tickAll invoked by
background job can be a cause of the flakiness (it is triggered every 5 seconds
and the test may run for ~7 seconds)
The error is reproduced by temporary adjusting the code to run the job more
frequently.
To avoid this flakiness I am going to add a logic to disable the background job
in the test
> Flaky test - org.apache.cassandra.metrics.ThreadLocalMeterTest
> --------------------------------------------------------------
>
> Key: CASSANDRA-21056
> URL: https://issues.apache.org/jira/browse/CASSANDRA-21056
> Project: Apache Cassandra
> Issue Type: Bug
> Components: Observability/Metrics
> Reporter: Dmitry Konstantinov
> Assignee: Dmitry Konstantinov
> Priority: Normal
> Fix For: 5.x
>
>
> [https://ci-cassandra.apache.org/job/Cassandra-trunk/2337/testReport/junit/org.apache.cassandra.metrics/ThreadLocalMeterTest/Tests___test_cdc_jdk17_2_20___testAllocationAndDestroy_cdc_jdk17_x86_64/]
> {code:java}
> junit.framework.AssertionFailedError:
> Expecting actual:
> 1.2319146708439048
> to be close to:
> 1.3389730444048518
> by less than 0.001 but difference was 0.107058373560947.
> (a difference of exactly 0.001 being considered valid)
> at
> org.apache.cassandra.metrics.ThreadLocalMeterTest.assertMeter(ThreadLocalMeterTest.java:176)
> at
> org.apache.cassandra.metrics.ThreadLocalMeterTest.testAllocationAndDestroy(ThreadLocalMeterTest.java:147)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
> {code}
> junit.framework.AssertionFailedError:
> Expecting actual:
> 1.3524125090043786
> to be close to:
> 1.4699426326600247
> by less than 0.001 but difference was 0.1175301236556461.
> (a difference of exactly 0.001 being considered valid)
> at
> org.apache.cassandra.metrics.ThreadLocalMeterTest.assertMeter(ThreadLocalMeterTest.java:176)
> at
> org.apache.cassandra.metrics.ThreadLocalMeterTest.testAllocationAndDestroy(ThreadLocalMeterTest.java:147)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
> {code}
> junit.framework.AssertionFailedError:
> Expecting actual:
> 1.3787741172386192
> to be close to:
> 1.4985951714017127
> by less than 0.001 but difference was 0.1198210541630935.
> (a difference of exactly 0.001 being considered valid)
> at
> org.apache.cassandra.metrics.ThreadLocalMeterTest.assertMeter(ThreadLocalMeterTest.java:176)
> at
> org.apache.cassandra.metrics.ThreadLocalMeterTest.testAllocationAndDestroy(ThreadLocalMeterTest.java:147)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]