diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-07-17 19:49:00 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-07-17 19:49:00 +0900 |
commit | b998e6b79d3fa9326d4426ab8138a1e8bf0e2d0d (patch) | |
tree | 92a567159b7fe83ad24ffd0a3cefdab92829e2ee /test/ruby | |
parent | fa30b99c34291cde7b17cc709552bc5681729a12 (diff) | |
download | ruby-b998e6b79d3fa9326d4426ab8138a1e8bf0e2d0d.tar.gz |
Run `Process.warmup` tests in separate processes
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_process.rb | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 3642f955e8..988618ecb8 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2689,18 +2689,25 @@ EOS end if Process.respond_to?(:_fork) def test_warmup_promote_all_objects_to_oldgen - obj = Object.new + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + obj = Object.new - refute_includes(ObjectSpace.dump(obj), '"old":true') - Process.warmup - assert_includes(ObjectSpace.dump(obj), '"old":true') + Process.warmup + refute_include(ObjectSpace.dump(obj), '"old":true') + Process.warmup + assert_include(ObjectSpace.dump(obj), '"old":true') + end; end def test_warmup_run_major_gc_and_compact - major_gc_count = GC.stat(:major_gc_count) - compact_count = GC.stat(:compact_count) - Process.warmup - assert_equal major_gc_count + 1, GC.stat(:major_gc_count) - assert_equal compact_count + 1, GC.stat(:compact_count) + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + major_gc_count = GC.stat(:major_gc_count) + compact_count = GC.stat(:compact_count) + Process.warmup + assert_equal major_gc_count + 1, GC.stat(:major_gc_count) + assert_equal compact_count + 1, GC.stat(:compact_count) + end; end end |