diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb index 84828d498543aa..7e0c499dd9c82c 100644 --- a/test/ruby/test_gc_compact.rb +++ b/test/ruby/test_gc_compact.rb @@ -324,7 +324,7 @@ def test_moving_arrays_up_heaps }.resume stats = GC.verify_compaction_references(expand_heap: true, toward: :empty) - assert_operator(stats.dig(:moved_up, :T_ARRAY) || 0, :>=, ARY_COUNT - 15) + assert_operator(stats.dig(:moved_up, :T_ARRAY) || 0, :>=, (0.9995 * ARY_COUNT).to_i) refute_empty($arys.keep_if { |o| ObjectSpace.dump(o).include?('"embedded":true') }) end; end diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 4f6dc0043283e8..6ebfb9e93b81ad 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -448,9 +448,11 @@ def export(revision, url, dir, keep_temp = false) end def branch_beginning(url) - cmd_read(%W[ #{COMMAND} log -n1 --format=format:%H + files = %w[version.h include/ruby/version.h] + year = cmd_read(%W[ #{COMMAND} log -n1 --format=%cd --date=format:%Y #{url} --] + files).to_i + cmd_read(%W[ #{COMMAND} log --format=format:%H --reverse --since=#{year-1}-12-25 --author=matz --committer=matz --grep=started\\.$ - #{url.to_str} -- version.h include/ruby/version.h]) + #{url} --] + files)[/.*/] end def export_changelog(url = '@', from = nil, to = nil, _path = nil, path: _path, base_url: true)