Skip to content

Commit e46c433

Browse files
authored
fix: clean up resources after test run (#296)
1 parent 0ab4680 commit e46c433

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/suites/integration/https_listener_weighted_rule_with_service_export_import_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ import (
1818
)
1919

2020
var _ = Describe("Test 2 listeners gateway with weighted httproute rules and service export import", func() {
21+
// Clean up resources in case an assertion failed before cleaning up
22+
// at the end
23+
AfterEach(func() {
24+
testFramework.CleanTestEnvironment(ctx)
25+
})
26+
2127
It("Create a gateway with 2 listeners(http and https), create a weightedRoutingHttpRoute that parentRef to both http and https listeners,"+
2228
" and this httpRoute BackendRef to one service and one serviceImport, weighted traffic should work for both http and https listeners",
2329
func() {
@@ -134,7 +140,7 @@ var _ = Describe("Test 2 listeners gateway with weighted httproute rules and ser
134140
} else if strings.Contains(stdout, "service-import-export-test1 handler pod") {
135141
hitTg1++
136142
} else {
137-
Fail("Unexpected response")
143+
Fail(fmt.Sprintf("Unexpected response: %s", stdout))
138144
}
139145
}
140146
log.Printf("Send traffic to %s listener: \n", protocol)

0 commit comments

Comments
 (0)