@@ -116,6 +116,8 @@ class OutboundIdleShutdownSpec extends ArteryMultiNodeSpec(s"""
116116 val remoteUid = futureUniqueRemoteAddress(association).futureValue.uid
117117
118118 localArtery.quarantine(remoteAddress, Some (remoteUid), " Test" )
119+ association.associationState.isQuarantined(remoteUid) shouldBe true
120+ association.associationState.isHarmlessQuarantined(remoteUid) shouldBe false
119121
120122 eventually {
121123 assertStreamActive(association, Association .ControlQueueIndex , expected = false )
@@ -128,6 +130,26 @@ class OutboundIdleShutdownSpec extends ArteryMultiNodeSpec(s"""
128130 }
129131 }
130132
133+ " eliminate quarantined association when not used (harmless=true)" in withAssociation {
134+ (_, remoteAddress, _, localArtery, _) =>
135+ val association = localArtery.association(remoteAddress)
136+ val remoteUid = futureUniqueRemoteAddress(association).futureValue.uid
137+
138+ localArtery.quarantine(remoteAddress, Some (remoteUid), " HarmlessTest" , harmless = true )
139+ association.associationState.isQuarantined(remoteUid) shouldBe true
140+ association.associationState.isHarmlessQuarantined(remoteUid) shouldBe true
141+
142+ eventually {
143+ assertStreamActive(association, Association .ControlQueueIndex , expected = false )
144+ assertStreamActive(association, Association .OrdinaryQueueIndex , expected = false )
145+ }
146+
147+ // the outbound streams are inactive and association quarantined, then it's completely removed
148+ eventually {
149+ localArtery.remoteAddresses should not contain remoteAddress
150+ }
151+ }
152+
131153 " remove inbound compression after quarantine" in withAssociation { (_, remoteAddress, _, localArtery, _) =>
132154 val association = localArtery.association(remoteAddress)
133155 val remoteUid = futureUniqueRemoteAddress(association).futureValue.uid
0 commit comments