Skip to content

Commit 5e00b3b

Browse files
committed
Revert GlobalState caching in ExpectationsTestRunner
GlobalState.new only costs ~2ms. Caching it had no measurable impact on test duration and introduced shared mutable state across tests within the same class.
1 parent 7a0dee2 commit 5e00b3b

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

test/requests/support/expectations_test_runner.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ class ExpectationsTestRunner < Minitest::Test
88
TEST_PRISM_FIXTURES = File.join(TEST_FIXTURES_DIR, "prism/test/prism/fixtures/**", "*.txt")
99

1010
def setup
11-
@global_state = self.class.shared_global_state
11+
@global_state = RubyLsp::GlobalState.new
1212
end
1313

1414
class << self
15-
def shared_global_state
16-
@shared_global_state ||= RubyLsp::GlobalState.new
17-
end
18-
1915
def expectations_tests(handler_class, expectation_suffix)
2016
class_eval(<<~RB, __FILE__, __LINE__ + 1)
2117
module ExpectationsRunnerMethods

0 commit comments

Comments
 (0)