Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip under_gc_compact_stress on s390x #10073

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions test/ruby/test_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,7 @@ def test_slice_out_of_range
end

def test_slice_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress { assert_equal([1, 2, 3, 4, 5], (0..10).to_a[1, 5]) }
EnvUtil.under_gc_compact_stress do
a = [0, 1, 2, 3, 4, 5]
Expand Down
2 changes: 2 additions & 0 deletions test/ruby/test_enumerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def test_with_index
end

def test_with_index_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
assert_equal([[1, 0], [2, 1], [3, 2]], @obj.to_enum(:foo, 1, 2, 3).with_index.to_a)
assert_equal([[1, 5], [2, 6], [3, 7]], @obj.to_enum(:foo, 1, 2, 3).with_index(5).to_a)
Expand Down Expand Up @@ -863,6 +864,7 @@ def test_lazy_chain
end

def test_lazy_chain_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
ea = (10..).lazy.select(&:even?).take(10)
ed = (20..).lazy.select(&:odd?)
Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ def test_detailed_message
end

def test_detailed_message_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
e = RuntimeError.new("foo\nbar\nbaz")
assert_equal("foo (RuntimeError)\nbar\nbaz", e.detailed_message)
Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ def m.bar; :bar; end
end

def test_clone_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
o = Object.new
def o.foo; :foo; end
Expand Down
3 changes: 3 additions & 0 deletions test/ruby/test_regexp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def test_to_s
end

def test_to_s_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
str = "abcd\u3042"
[:UTF_16BE, :UTF_16LE, :UTF_32BE, :UTF_32LE].each do |es|
Expand Down Expand Up @@ -470,6 +471,7 @@ def test_inspect
end

def test_inspect_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
assert_equal('/(?-mix:\\/)|/', Regexp.union(/\//, "").inspect)
end
Expand Down Expand Up @@ -891,6 +893,7 @@ def test_match
end

def test_match_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
m = /(?<foo>.)(?<n>[^aeiou])?(?<bar>.+)/.match("hoge\u3042")
assert_equal("h", m.match(:foo))
Expand Down
5 changes: 5 additions & 0 deletions test/ruby/test_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ def test_undump
end

def test_undump_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
a = S("Test") << 1 << 2 << 3 << 9 << 13 << 10
EnvUtil.under_gc_compact_stress do
assert_equal(a, S('"Test\\x01\\x02\\x03\\t\\r\\n"').undump)
Expand Down Expand Up @@ -1284,6 +1285,7 @@ def test_gsub
end

def test_gsub_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress { assert_equal(S("h<e>ll<o>"), S("hello").gsub(/([aeiou])/, S('<\1>'))) }
end

Expand Down Expand Up @@ -1331,6 +1333,7 @@ def test_gsub!
end

def test_gsub_bang_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
a = S("hello")
a.gsub!(/([aeiou])/, S('<\1>'))
Expand Down Expand Up @@ -1672,6 +1675,7 @@ def test_scan
end

def test_scan_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress { assert_equal([["1a"], ["2b"], ["3c"]], S("1a2b3c").scan(/(\d.)/)) }
end

Expand Down Expand Up @@ -2103,6 +2107,7 @@ def o.to_s; self; end
end

def test_sub_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
m = /&(?<foo>.*?);/.match(S("aaa &amp; yyy"))
assert_equal("amp", m["foo"])
Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_symbol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def test_inspect
end

def test_inspect_under_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress do
assert_inspect_evaled(':testing')
end
Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_weakkeymap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def test_compaction
end

def test_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress { ObjectSpace::WeakKeyMap.new }
end

Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_weakmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def test_compaction
end

def test_gc_compact_stress
omit "compaction doesn't work well on s390x" if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
EnvUtil.under_gc_compact_stress { ObjectSpace::WeakMap.new }
end

Expand Down
1 change: 1 addition & 0 deletions tool/lib/envutil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def under_gc_stress(stress = true)
module_function :under_gc_stress

def under_gc_compact_stress(val = :empty, &block)
raise "compaction doesn't work well on s390x. Omit the test in the caller." if RUBY_PLATFORM =~ /s390x/ # https://github.com/ruby/ruby/pull/5077
auto_compact = GC.auto_compact
GC.auto_compact = val
under_gc_stress(&block)
Expand Down