Skip to content

Commit eaec74f

Browse files
committed
stub test for harmless=true
Update OutboundIdleShutdownSpec.scala Update OutboundIdleShutdownSpec.scala
1 parent e21fa9e commit eaec74f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)