Skip to content

Commit ee323ed

Browse files
peterzhu2118st0012
authored andcommitted
Skip tests that would incorrectly fail valgrind
1 parent 40b6616 commit ee323ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/rbs/test/runtime_test_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def test_runtime_test_with_sample_size
2020
end
2121

2222
def test_runtime_test_error_with_invalid_sample_size
23+
# Skip this test if running under Valgrind because `RUBY_FREE_AT_EXIT` has a bug.
24+
# See: https://bugs.ruby-lang.org/issues/21173
25+
omit if ENV["RUBY_MEMCHECK_RUNNING"]
26+
2327
string_err_msg = refute_test_success(other_env: {"RBS_TEST_SAMPLE_SIZE" => 'yes'})
2428
assert_match(/E, .+ ERROR -- rbs: Sample size should be a positive integer: `.+`\n/, string_err_msg)
2529

@@ -93,6 +97,9 @@ def refute_test_success(other_env: {}, rbs_content: nil, ruby_content: nil)
9397
end
9498

9599
def test_test_target
100+
# Skip this test if running under Valgrind because `RUBY_FREE_AT_EXIT` has a bug.
101+
# See: https://bugs.ruby-lang.org/issues/21173
102+
omit if ENV["RUBY_MEMCHECK_RUNNING"]
96103
output = refute_test_success(other_env: { "RBS_TEST_TARGET" => nil })
97104
assert_match "test/setup handles the following environment variables:", output
98105
end

0 commit comments

Comments
 (0)