Skip to content

Commit

Permalink
Fixed the flaky test in the ProtectedPathSpec
Browse files Browse the repository at this point in the history
Implements #5390
Related to #5608

* Fixed the test "Flow swaps to protected path when main path gets
  broken, becomes DEGRADED if protected path is unable to
  reroute(no bw)"
* Earlier in some cases when the switchPair was set to 2-3 or 8-9,
  the protected path had only 1 ISL and it had enough BW, so the
  test failed because the BW was not reduced for some protected
  path ISLs.
* Now this test passes even when the swPair is 2-3 or 8-9, and
  other switches. So the temporary fix to skip 8-9 switches
  is removed.
* Removed the workaround to skip 8-9 from 2 tests
  • Loading branch information
izadorozhna committed Apr 25, 2024
1 parent f33cc85 commit 7dc6659
Showing 1 changed file with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,21 +373,15 @@ class ProtectedPathSpec extends HealthCheckSpecification {
@Tags([ISL_RECOVER_ON_FAIL, ISL_PROPS_DB_RESET])
def "Flow swaps to protected path when main path gets broken, becomes DEGRADED if protected path is unable to reroute(no bw)"() {
given: "Two switches with 2 diverse paths at least"
//def switchPair = switchPairs.all().withAtLeastNNonOverlappingPaths(2).random()
//https://github.com/telstra/open-kilda/issues/5608
def switchesWhere5608IsReproducible = topology.activeSwitches.findAll {it.dpId.toString().endsWith("08")
||it.dpId.toString().endsWith("09")}
def switchPair = switchPairs.all()
.excludeSwitches(switchesWhere5608IsReproducible)
.withAtLeastNNonOverlappingPaths(2).random()
def switchPair = switchPairs.all().withAtLeastNNonOverlappingPaths(2).random()

when: "Create flow with protected path"
def flow = flowHelperV2.randomFlow(switchPair).tap { allocateProtectedPath = true }
flowHelperV2.addFlow(flow)
def path = northbound.getFlowPath(flow.flowId)

and: "Other paths have not enough bandwidth to host the flow in case of reroute"
def otherIsls = switchPair.paths.findAll { it != pathHelper.convert(path.protectedPath) &&
def otherIsls = switchPair.paths.findAll {
it != pathHelper.convert(path) }.collectMany { pathHelper.getInvolvedIsls(it) }
.unique { a, b -> a == b || a == b.reversed ? 0 : 1 }
otherIsls.collectMany{[it, it.reversed]}.each {
Expand Down Expand Up @@ -436,14 +430,7 @@ Failed to find path with requested bandwidth=$flow.maximumBandwidth/
@Tags(ISL_RECOVER_ON_FAIL)
def "Flow swaps to protected path when main path gets broken, becomes DEGRADED if protected path is unable to reroute(no path)"() {
given: "Two switches with 2 diverse paths at least"
//def switchPair = switchPairs.all().withAtLeastNNonOverlappingPaths(2).random()
//https://github.com/telstra/open-kilda/issues/5608
def switchesWhere5608IsReproducible = topology.activeSwitches.findAll {it.dpId.toString().endsWith("08")
||it.dpId.toString().endsWith("09")}
def switchPair = switchPairs.all()
.excludeSwitches(switchesWhere5608IsReproducible)
.withAtLeastNNonOverlappingPaths(2).random()
def switchPair = switchPairs.all().withAtLeastNNonOverlappingPaths(2).random()
when: "Create flow with protected path"
def flow = flowHelperV2.randomFlow(switchPair).tap { allocateProtectedPath = true }
Expand Down

0 comments on commit 7dc6659

Please sign in to comment.