ClusterDeathWatchSpec: assert cluster status bewtween tests (#25126)

Test failed due to node4 still seeing node3 in a subsequent test
but assumed it had been removed.

Fixes #25065
This commit is contained in:
Christopher Batey 2018-05-29 12:38:20 +01:00 committed by Arnout Engelen
parent 034f6c5c96
commit 485179c5f6

View file

@ -89,15 +89,16 @@ abstract class ClusterDeathWatchSpec
watchEstablished.await watchEstablished.await
enterBarrier("watch-established") enterBarrier("watch-established")
expectMsg(path2) expectMsg(path2)
expectNoMsg(2 seconds) expectNoMessage(2.seconds)
enterBarrier("second-terminated") enterBarrier("second-terminated")
awaitAssert(clusterView.members.map(_.address) should not contain address(second))
markNodeAsUnavailable(third) markNodeAsUnavailable(third)
awaitAssert(clusterView.unreachableMembers.map(_.address) should contain(address(third))) awaitAssert(clusterView.unreachableMembers.map(_.address) should contain(address(third)))
cluster.down(third) cluster.down(third)
// removed // removed
awaitAssert(clusterView.members.map(_.address) should not contain (address(third))) awaitAssert(clusterView.members.map(_.address) should not contain address(third))
awaitAssert(clusterView.unreachableMembers.map(_.address) should not contain (address(third))) awaitAssert(clusterView.unreachableMembers.map(_.address) should not contain address(third))
expectMsg(path3) expectMsg(path3)
enterBarrier("third-terminated") enterBarrier("third-terminated")
@ -112,11 +113,15 @@ abstract class ClusterDeathWatchSpec
awaitAssert(clusterView.unreachableMembers.map(_.address) should contain(address(second))) awaitAssert(clusterView.unreachableMembers.map(_.address) should contain(address(second)))
cluster.down(second) cluster.down(second)
// removed // removed
awaitAssert(clusterView.members.map(_.address) should not contain (address(second))) awaitAssert(clusterView.members.map(_.address) should not contain address(second))
awaitAssert(clusterView.unreachableMembers.map(_.address) should not contain (address(second))) awaitAssert(clusterView.unreachableMembers.map(_.address) should not contain address(second))
} }
enterBarrier("second-terminated") enterBarrier("second-terminated")
enterBarrier("third-terminated") enterBarrier("third-terminated")
runOn(fourth) {
awaitAssert(clusterView.members.map(_.address) should not contain address(second))
awaitAssert(clusterView.members.map(_.address) should not contain address(third))
}
} }
runOn(fifth) { runOn(fifth) {