Publish member events when state change first seen, see #3075
* Remove InstantMemberEvent
This commit is contained in:
parent
5c7747e7fa
commit
5b844ec1e6
32 changed files with 145 additions and 517 deletions
|
|
@ -92,33 +92,15 @@ abstract class ConvergenceSpec(multiNodeConfig: ConvergenceMultiNodeConfig)
|
|||
def memberStatus(address: Address): Option[MemberStatus] =
|
||||
clusterView.members.collectFirst { case m if m.address == address ⇒ m.status }
|
||||
|
||||
def assertNotMovedUp(joining: Boolean): Unit = {
|
||||
within(20 seconds) {
|
||||
if (joining) awaitCond(clusterView.members.size == 0)
|
||||
else awaitCond(clusterView.members.size == 2)
|
||||
awaitSeenSameState(first, second, fourth)
|
||||
if (joining) memberStatus(first) must be(None)
|
||||
else memberStatus(first) must be(Some(MemberStatus.Up))
|
||||
if (joining) memberStatus(second) must be(None)
|
||||
else memberStatus(second) must be(Some(MemberStatus.Up))
|
||||
// leader is not allowed to move the new node to Up
|
||||
memberStatus(fourth) must be(None)
|
||||
}
|
||||
}
|
||||
|
||||
enterBarrier("after-join")
|
||||
|
||||
runOn(first, second) {
|
||||
runOn(first, second, fourth) {
|
||||
for (n ← 1 to 5) {
|
||||
assertNotMovedUp(joining = false)
|
||||
// wait and then check again
|
||||
Thread.sleep(1.second.dilated.toMillis)
|
||||
}
|
||||
}
|
||||
|
||||
runOn(fourth) {
|
||||
for (n ← 1 to 5) {
|
||||
assertNotMovedUp(joining = true)
|
||||
awaitCond(clusterView.members.size == 2)
|
||||
awaitSeenSameState(first, second, fourth)
|
||||
memberStatus(first) must be(Some(MemberStatus.Up))
|
||||
memberStatus(second) must be(Some(MemberStatus.Up))
|
||||
memberStatus(fourth) must be(None)
|
||||
// wait and then check again
|
||||
Thread.sleep(1.second.dilated.toMillis)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue