Ok I managed to do it without copying akka internal classes.
I'm not sure what I was doing wrong but this seems to work:

enterBarrier("before-split")
runOn(first) {
  // split the cluster in two parts (first, second) / (third, fourth, fifth)
  for (role1 ← side1; role2 ← side2) {
    testConductor.blackhole(role1, role2, Direction.Both).await
  }
}
enterBarrier("after-split")

runOn(side1: _*) {
  receiveN(side2.size).collect { case MemberRemoved(m, _) => m.address }.toSet 
should be(
    side2.map(node(_).address).toSet)
}

runOn(side2: _*) {
  receiveN(side1.size).collect { case MemberRemoved(m, _) => m.address }.toSet 
should be(
    side1.map(node(_).address).toSet)
}


On Friday, 10 July 2015 09:41:58 UTC+2, Giovanni Alberto Caporaletti wrote:
>
> Thank you very much, I'll have a look at it.
>
> My main problem was being able to create barriers on isolated group of 
> nodes having only one central coordinator.
>
> I hope to have to look at this before the end of the week! I'll let you 
> know
>
> cheers
> G
>
> On Friday, 10 July 2015 08:51:14 UTC+2, delasoul wrote:
>>
>>
>> https://github.com/akka/akka/blob/master/akka-cluster/src/multi-jvm/scala/akka/cluster/SplitBrainSpec.scala
>>
>> On Thursday, 9 July 2015 20:16:40 UTC+2, Giovanni Alberto Caporaletti 
>> wrote:
>>>
>>> Hi.
>>>
>>> Is there a way I can simulate a network partition using sbt-multijvm and 
>>> tools like testConductor.blackhole? I've been trying for a couple of hours 
>>> but I haven't been successful. 
>>> I won't even post my attempts because they are really useless :D
>>>
>>> Has any of you ever done that?
>>>
>>>
>>> Thanks
>>>
>>> G
>>>
>>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to