Make joining to the same node multiple times work, and reenable blackhole test. See #2930
This commit is contained in:
parent
f18575e251
commit
5827a27b94
5 changed files with 57 additions and 27 deletions
|
|
@ -182,6 +182,27 @@ trait MultiNodeClusterSpec extends Suite with STMultiNodeSpec with WatchedByCoro
|
|||
enterBarrier(roles.map(_.name).mkString("-") + "-joined")
|
||||
}
|
||||
|
||||
/**
|
||||
* Join the specific node within the given period by sending repeated join
|
||||
* requests at periodic intervals until we succeed.
|
||||
*/
|
||||
def joinWithin(joinNode: RoleName, max: Duration = remaining, interval: Duration = 1.second): Unit = {
|
||||
def memberInState(member: Address, status: Seq[MemberStatus]): Boolean =
|
||||
clusterView.members.exists { m ⇒ (m.address == member) && status.contains(m.status) }
|
||||
|
||||
cluster join joinNode
|
||||
awaitCond({
|
||||
clusterView.refreshCurrentState()
|
||||
if (memberInState(joinNode, List(MemberStatus.up)) &&
|
||||
memberInState(myself, List(MemberStatus.Joining, MemberStatus.Up)))
|
||||
true
|
||||
else {
|
||||
cluster join joinNode
|
||||
false
|
||||
}
|
||||
}, max, interval)
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the member addresses match the expected addresses in the
|
||||
* sort order used by the cluster.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue