diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala index 39beddb4a23..daa82a373af 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala @@ -116,6 +116,8 @@ class OutboundIdleShutdownSpec extends ArteryMultiNodeSpec(s""" val remoteUid = futureUniqueRemoteAddress(association).futureValue.uid localArtery.quarantine(remoteAddress, Some(remoteUid), "Test") + association.associationState.isQuarantined(remoteUid) shouldBe true + association.associationState.isHarmlessQuarantined(remoteUid) shouldBe false eventually { assertStreamActive(association, Association.ControlQueueIndex, expected = false) @@ -128,6 +130,26 @@ class OutboundIdleShutdownSpec extends ArteryMultiNodeSpec(s""" } } + "eliminate quarantined association when not used (harmless=true)" in withAssociation { + (_, remoteAddress, _, localArtery, _) => + 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 + association.associationState.isHarmlessQuarantined(remoteUid) shouldBe true + + eventually { + assertStreamActive(association, Association.ControlQueueIndex, expected = false) + assertStreamActive(association, Association.OrdinaryQueueIndex, expected = false) + } + + // the outbound streams are inactive and association quarantined, then it's completely removed + eventually { + localArtery.remoteAddresses should not contain remoteAddress + } + } + "remove inbound compression after quarantine" in withAssociation { (_, remoteAddress, _, localArtery, _) => val association = localArtery.association(remoteAddress) val remoteUid = futureUniqueRemoteAddress(association).futureValue.uid