harden ReplicatorPruningSpec (#31215)

Check update has propagated before sending the next one

Fixes #28491
This commit is contained in:
Arnout Engelen 2022-03-08 14:14:07 +01:00 committed by GitHub
parent ccb542734e
commit 8f72872478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -230,10 +230,22 @@ class ReplicatorPruningSpec extends MultiNodeSpec(ReplicatorPruningSpec) with ST
retrieved.value should be(expectedValue)
}
}
def checkValuePropagated(expectedValue: Int): Unit =
awaitAssert {
replicator ! Get(KeyA, ReadLocal)
expectMsgPF() {
case g @ GetSuccess(KeyA, _) =>
g.get(KeyA).value.toInt should be(expectedValue)
}
}
runOn(first) {
updateAfterPruning(expectedValue = 10)
}
runOn(second) {
checkValuePropagated(10)
}
enterBarrier("update-first-after-pruning")
runOn(second) {
@ -248,6 +260,10 @@ class ReplicatorPruningSpec extends MultiNodeSpec(ReplicatorPruningSpec) with ST
runOn(first) {
updateAfterPruning(expectedValue = 12)
}
runOn(second) {
checkValuePropagated(12)
}
enterBarrier("update-first-after-dissemination")
runOn(second) {