Details
Description
org.apache.cassandra.tools.TopPartitionsTest#testServiceTopPartitionsSingleTable fails randomly and quite frequently on CI:
Based on the source code - the most probably cause of this flakiness is async logic when we submit a sample here: org.apache.cassandra.metrics.Sampler#addSample - the submitted task can executed after we invoke finishLocalSampling(..) within the test.
The failure can be emulated by adding a synthetic delay to this logic like this:
public void addSample(final T item, final int value) { if (isEnabled()) samplerExecutor.submit(() -> { // ------ synthetic delay ----- try { Thread.sleep(10000); } catch (Exception e) {}; // ----------------------- ----- insert(item, value); }); }
Attachments
Attachments
Issue Links
- duplicates
-
CASSANDRA-17798 Flaky org.apache.cassandra.tools TopPartitionsTest testServiceTopPartitionsSingleTable
- Open
- relates to
-
CASSANDRA-17455 Flaky org.apache.cassandra.tools TopPartitionsTest testServiceTopPartitionsSingleTable
- Resolved
-
CASSANDRA-14360 Allow nodetool toppartitions without specifying table
- Resolved
- links to