Skip to content

Commit 4ef77e1

Browse files
committed
Defer ResetOpenAPI() in tests, so that OpenAPI schema could be reset even if those tests failed
1 parent 8bbac4a commit 4ef77e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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)