Skip to content

[BUG] [Segment Replication] Flaky test SegmentReplicationTargetServiceTests.testReplicationOnDone #4184

Closed
@dreamer-89

Description

@dreamer-89

Describe the bug
Unit test OngoingSegmentReplicationsTests.testMultipleReplicasUseSameCheckpoint fails intermittenly on gradle check.

REPRODUCE WITH: ./gradlew ':server:test' --tests "org.opensearch.indices.replication.SegmentReplicationTargetServiceTests.testReplicationOnDone" -Dtests.seed=18F9CB5CD66407EA -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=ms -Dtests.timezone=Europe/Sofia -Druntime.java=17

org.opensearch.indices.replication.SegmentReplicationTargetServiceTests > testReplicationOnDone FAILED
    org.mockito.exceptions.verification.TooFewActualInvocations: 
    segmentReplicationTargetService.onNewCheckpoint(
        ReplicationCheckpoint{shardId=[index][0], primaryTerm=94, segmentsGen=3, seqNo=-1, version=9},
        <any>
    );
    Wanted 2 times:
    -> at org.opensearch.indices.replication.SegmentReplicationTargetServiceTests.testReplicationOnDone(SegmentReplicationTargetServiceTests.java:236)
    But was 1 time:
    -> at org.opensearch.indices.replication.SegmentReplicationTargetServiceTests.testReplicationOnDone(SegmentReplicationTargetServiceTests.java:230)
        at __randomizedtesting.SeedInfo.seed([18F9CB5CD66407EA:2371B911C98E848]:0)
        at app//org.opensearch.indices.replication.SegmentReplicationTargetServiceTests.testReplicationOnDone(SegmentReplicationTargetServiceTests.java:236)

To Reproduce
Steps to reproduce the behavior:

  1. Run above test continuously, it may fail with above error.

Expected behavior
Test should not fail

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdistributed frameworkenhancementEnhancement or improvement to existing feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions