Fix race in testSendSnapshotSendsOps (#59831)
There is a race between increase and get the global checkpoint in the test as indexTranslogOperations can be executed concurrently. Closes #59492
This commit is contained in:
parent
cc6edc39a1
commit
0031dea9cc
|
@ -245,7 +245,9 @@ public class RecoverySourceHandlerTests extends ESTestCase {
|
|||
public void indexTranslogOperations(List<Translog.Operation> operations, int totalTranslogOps, long timestamp, long msu,
|
||||
RetentionLeases retentionLeases, long mappingVersion, ActionListener<Long> listener) {
|
||||
shippedOps.addAll(operations);
|
||||
checkpointOnTarget.set(randomLongBetween(checkpointOnTarget.get(), Long.MAX_VALUE));
|
||||
if (randomBoolean()) {
|
||||
checkpointOnTarget.addAndGet(between(1, 20));
|
||||
}
|
||||
listener.onResponse(checkpointOnTarget.get());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue