add Reason to CoordinatedShutdown, #24048

This commit is contained in:
Patrik Nordwall 2017-12-04 12:22:59 +01:00
parent fa3da328be
commit e49acb7daa
6 changed files with 116 additions and 28 deletions

View file

@ -158,7 +158,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender {
Cluster(sys2).join(Cluster(sys2).selfAddress)
probe.expectMsgType[MemberUp]
CoordinatedShutdown(sys2).run()
CoordinatedShutdown(sys2).run(CoordinatedShutdown.UnknownReason)
probe.expectMsgType[MemberLeft]
probe.expectMsgType[MemberExited]
probe.expectMsgType[MemberRemoved]
@ -187,6 +187,7 @@ class ClusterSpec extends AkkaSpec(ClusterSpec.config) with ImplicitSender {
probe.expectMsgType[MemberRemoved]
Await.result(sys2.whenTerminated, 10.seconds)
Cluster(sys2).isTerminated should ===(true)
CoordinatedShutdown(sys2).shutdownReason() should ===(Some(CoordinatedShutdown.ClusterLeavingReason))
} finally {
shutdown(sys2)
}
@ -212,6 +213,7 @@ akka.loglevel=DEBUG
probe.expectMsgType[MemberRemoved]
Await.result(sys3.whenTerminated, 10.seconds)
Cluster(sys3).isTerminated should ===(true)
CoordinatedShutdown(sys3).shutdownReason() should ===(Some(CoordinatedShutdown.ClusterDowningReason))
} finally {
shutdown(sys3)
}