Skip to content

Commit ca82922

Browse files
committed
Revert "Optimize TestConfig.reset to only run when context changes"
This reverts the optimization because it broke test isolation. Tests use Config.config.set() to override config values, and without TestConfig.reset between tests, these changes persist and pollute subsequent tests. For example, tests setting max_annotations_per_resource=1 caused other tests to fail with "AnnotationLimitExceeded" errors.
1 parent 34d3c36 commit ca82922

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

spec/spec_helper.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,8 @@
136136
Sequel::Deprecation.output = StringIO.new
137137
Sequel::Deprecation.backtrace_filter = 5
138138

139-
new_context = example.metadata[:job_context] || :api
140-
if TestConfig.context != new_context
141-
TestConfig.context = new_context
142-
TestConfig.reset
143-
end
139+
TestConfig.context = example.metadata[:job_context] || :api
140+
TestConfig.reset
144141

145142
VCAP::CloudController::SecurityContext.clear
146143
VCAP::Request.current_id = nil

0 commit comments

Comments
 (0)