Skip to content

Commit

Permalink
test: Move instrumentation to AfterFailed instead of AfterAll
Browse files Browse the repository at this point in the history
[ upstream commit 9744ff0 ]

When inspecting a sysdump of this failing test, the expected artifacts
containing the instrumentation (debug-events) are not present. This is
because AfterAll is not called when the test fails. The logic should be
in AfterFailed.

Fixes: e63aa2b ("test: Instrument LB IP via BGP test with debug-events")
Fixes: #16445

Signed-off-by: Chris Tarazi <chris@isovalent.com>
Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
christarazi authored and aanm committed Jul 15, 2021
1 parent 362a984 commit 0b2da0e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/k8sT/Services.go
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,15 @@ Secondary Interface %s :: IPv4: (%s, %s), IPv6: (%s, %s)`, helpers.DualStackSupp
})

AfterAll(func() {
kubectl.Delete(frr)
kubectl.Delete(bgpConfigMap)
kubectl.Delete(lbSVC)
// Delete temp files
os.Remove(frr)
os.Remove(bgpConfigMap)
})

AfterFailed(func() {
res := kubectl.CiliumExecContext(
context.TODO(),
ciliumPodK8s1,
Expand All @@ -2671,13 +2680,6 @@ Secondary Interface %s :: IPv4: (%s, %s), IPv6: (%s, %s)`, helpers.DualStackSupp
res.CombineOutput().Bytes(),
"tests-loadbalancer-hubble-observe-debug-events-k8s2.log",
)

kubectl.Delete(frr)
kubectl.Delete(bgpConfigMap)
kubectl.Delete(lbSVC)
// Delete temp files
os.Remove(frr)
os.Remove(bgpConfigMap)
})

It("Connectivity to endpoint via LB", func() {
Expand Down

0 comments on commit 0b2da0e

Please sign in to comment.