Skip to content

Commit

Permalink
stub test for harmless=true
Browse files Browse the repository at this point in the history
Update OutboundIdleShutdownSpec.scala

Update OutboundIdleShutdownSpec.scala
  • Loading branch information
pjfanning committed Nov 8, 2024
1 parent e21fa9e commit eaec74f
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit eaec74f

Please sign in to comment.