Skip to content

Commit 0ee2053

Browse files
casperisfinebyroot
andauthored
Run GC.verify_compaction_references on CI (#1155)
Co-authored-by: Jean Boussier <[email protected]>
1 parent c5fa553 commit 0ee2053

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/spec_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
require 'yaml'
55
DatabaseCredentials = YAML.load_file('spec/configuration.yml')
66

7+
if GC.respond_to?(:verify_compaction_references)
8+
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
9+
# move objects around, helping to find object movement bugs.
10+
GC.verify_compaction_references(double_heap: true, toward: :empty)
11+
end
12+
713
RSpec.configure do |config|
814
config.disable_monkey_patching!
915

0 commit comments

Comments
 (0)