diff options
| author | Alan Wu <alanwu@ruby-lang.org> | 2024-08-29 13:54:55 -0400 |
|---|---|---|
| committer | Alan Wu <alanwu@ruby-lang.org> | 2024-08-29 13:54:55 -0400 |
| commit | e07f794967abfca691a275ebdbf0bfc2268a6057 (patch) | |
| tree | 6aa03bb417b35aeee304e499b3588adf9065170d /test/ruby | |
| parent | b74e0c5f6b3af5f6d94cbcade3e7eb6da97439ef (diff) | |
Stop using the "undef" keyword to remove a constant
The keyword tries to remove a method of the same name which is unlikely
to be the intention of this test:
$ ruby -e 'undef Object'
-e:1:in '<main>': undefined method 'Object' for class 'Object' (NameError)
Found looking at GH-11497. The NameError triggers error_highlight, which
loads a bunch of file under GC.stress set by this test when using Prism.
That takes a long time, causing a timeout.
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_refinement.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 11acf31f21..913c968d35 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -825,7 +825,7 @@ class TestRefinement < Test::Unit::TestCase GC.stress = true 10.times{ #{PrependAfterRefine_CODE} - undef PrependAfterRefine + Object.send(:remove_const, :PrependAfterRefine) } }, timeout: 60 end |
