Skip to content

Commit

Permalink
new test case
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Nov 12, 2024
1 parent be0ccc7 commit 9f76ded
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,30 @@ class OutboundIdleShutdownSpec extends ArteryMultiNodeSpec(s"""
}
}

"eliminate quarantined association when not used - SBR case (harmless=true)" in withAssociation {
(remoteSystem, remoteAddress, _, localArtery, localProbe) =>
// event to watch out for, indicator of the issue
remoteSystem.eventStream.subscribe(testActor, classOf[ThisActorSystemQuarantinedEvent])

val remoteEcho = remoteSystem.actorSelection("/user/echo").resolveOne(remainingOrDefault).futureValue

val localAddress = RARP(system).provider.getDefaultAddress

val localEchoRef = remoteSystem.actorSelection(RootActorPath(localAddress) / localProbe.ref.path.elements).resolveOne(remainingOrDefault).futureValue
remoteEcho.tell("ping", localEchoRef)
localProbe.expectMsg("ping")

val association = localArtery.association(remoteAddress)
val remoteUid = futureUniqueRemoteAddress(association).futureValue.uid
localArtery.quarantine(remoteAddress, Some(remoteUid), "HarmlessTest", harmless = true)
association.associationState.isQuarantined(remoteUid) shouldBe true

eventually {
remoteEcho.tell("ping", localEchoRef) // trigger sending message from remote to local, which will trigger local to wrongfully notify remote that it is quarantined
expectMsgType[ThisActorSystemQuarantinedEvent] // this is what remote emits when it learns it is quarantined by local. This is not correct and is what (with SBR enabled) triggers killing the node.
}
}

"remove inbound compression after quarantine" in withAssociation { (_, remoteAddress, _, localArtery, _) =>
val association = localArtery.association(remoteAddress)
val remoteUid = futureUniqueRemoteAddress(association).futureValue.uid
Expand Down

0 comments on commit 9f76ded

Please sign in to comment.