50
50
51
51
public class ReplicationTrackerRetentionLeaseTests extends ReplicationTrackerTestCase {
52
52
53
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/38245" )
54
53
public void testAddOrRenewRetentionLease () {
55
54
final AllocationId allocationId = AllocationId .newInitializing ();
56
55
long primaryTerm = randomLongBetween (1 , Long .MAX_VALUE );
@@ -72,13 +71,13 @@ public void testAddOrRenewRetentionLease() {
72
71
final int length = randomIntBetween (0 , 8 );
73
72
final long [] minimumRetainingSequenceNumbers = new long [length ];
74
73
for (int i = 0 ; i < length ; i ++) {
75
- minimumRetainingSequenceNumbers [i ] = randomLongBetween (SequenceNumbers .NO_OPS_PERFORMED , Long .MAX_VALUE );
76
- replicationTracker .addRetentionLease (
77
- Integer .toString (i ), minimumRetainingSequenceNumbers [i ], "test-" + i , ActionListener .wrap (() -> {}));
78
74
if (rarely () && primaryTerm < Long .MAX_VALUE ) {
79
75
primaryTerm = randomLongBetween (primaryTerm + 1 , Long .MAX_VALUE );
80
76
replicationTracker .setOperationPrimaryTerm (primaryTerm );
81
77
}
78
+ minimumRetainingSequenceNumbers [i ] = randomLongBetween (SequenceNumbers .NO_OPS_PERFORMED , Long .MAX_VALUE );
79
+ replicationTracker .addRetentionLease (
80
+ Integer .toString (i ), minimumRetainingSequenceNumbers [i ], "test-" + i , ActionListener .wrap (() -> {}));
82
81
assertRetentionLeases (replicationTracker , i + 1 , minimumRetainingSequenceNumbers , () -> 0L , primaryTerm , 1 + i , true );
83
82
}
84
83
0 commit comments