From eaec74f7641e6d940df16ebbde341f2be332d908 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 16 Oct 2024 16:23:07 +0100 Subject: [PATCH] stub test for harmless=true Update OutboundIdleShutdownSpec.scala Update OutboundIdleShutdownSpec.scala --- .../artery/OutboundIdleShutdownSpec.scala | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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