From 7dc6659a37f1bc1bf422d7e19044599af9dab271 Mon Sep 17 00:00:00 2001 From: Ievgeniia Zadorozhna Date: Thu, 25 Apr 2024 20:16:43 +0200 Subject: [PATCH] Fixed the flaky test in the ProtectedPathSpec 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 --- .../spec/flows/ProtectedPathSpec.groovy | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy index 7c290c337ee..cea711d5fd1 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy @@ -373,13 +373,7 @@ 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 } @@ -387,7 +381,7 @@ class ProtectedPathSpec extends HealthCheckSpecification { 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 { @@ -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 }