Skip to content

Commit

Permalink
Move GC verification to end of process in tests (ohler55#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 authored Oct 22, 2022
1 parent 04f9e60 commit e2c0fbd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
7 changes: 0 additions & 7 deletions test/test_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,6 @@ def setup

def teardown
Oj.default_options = @default_options
#=begin
if '3.1.0' <= RUBY_VERSION && !(RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/)
#Oj::debug_odd("teardown before GC.verify_compaction_references")
verify_gc_compaction
#Oj::debug_odd("teardown after GC.verify_compaction_references")
end
#=end
end

def test_nil
Expand Down
9 changes: 9 additions & 0 deletions test/tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@
require 'test_wab'
require 'test_writer'
require 'test_integer_range'

at_exit do
require 'helper'
if '3.1.0' <= RUBY_VERSION && !(RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/)
#Oj::debug_odd("teardown before GC.verify_compaction_references")
verify_gc_compaction
#Oj::debug_odd("teardown after GC.verify_compaction_references")
end
end
9 changes: 9 additions & 0 deletions test/tests_mimic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@
require 'json_generic_object_test'
require 'json_parser_test'
require 'json_string_matching_test'

at_exit do
require 'helper'
if '3.1.0' <= RUBY_VERSION && !(RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/)
#Oj::debug_odd("teardown before GC.verify_compaction_references")
verify_gc_compaction
#Oj::debug_odd("teardown after GC.verify_compaction_references")
end
end
9 changes: 9 additions & 0 deletions test/tests_mimic_addition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
$: << File.join(File.dirname(__FILE__), 'json_gem')

require 'json_addition_test'

at_exit do
require 'helper'
if '3.1.0' <= RUBY_VERSION && !(RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/)
#Oj::debug_odd("teardown before GC.verify_compaction_references")
verify_gc_compaction
#Oj::debug_odd("teardown after GC.verify_compaction_references")
end
end

0 comments on commit e2c0fbd

Please sign in to comment.