Skip to content

Commit 10ecc6f

Browse files
committed
Defer ResetOpenAPI() in tests, so that OpenAPI schema could be reset even if those tests failed
1 parent b7340bd commit 10ecc6f

File tree

2 files changed

+180
-5
lines changed

2 files changed

+180
-5
lines changed

api/krusty/openapicustomschema_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ spec:
143143
func runOpenApiTest(t *testing.T, test func(t *testing.T)) {
144144
t.Helper()
145145
openapi.ResetOpenAPI()
146+
defer openapi.ResetOpenAPI()
146147
test(t)
147-
openapi.ResetOpenAPI()
148148
}
149149

150150
// Test for issue #2825

0 commit comments

Comments
 (0)