From 6d05853148a102453cfa37a25729d61fd30168fd Mon Sep 17 00:00:00 2001 From: Kevin Menard Date: Tue, 24 Sep 2024 13:02:04 -0400 Subject: [PATCH] Ensure the patterns to retain MRI test exclusions are not matched against the test name. --- tool/jt.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tool/jt.rb b/tool/jt.rb index 237afed3bdf..e21c7f860d2 100755 --- a/tool/jt.rb +++ b/tool/jt.rb @@ -1390,8 +1390,14 @@ def retag(*args) FileUtils::Verbose.rm_r file # We know some tests hang and odds are very good they're going to continue to hang, so let's keep those - # tests as excluded and manually inspect them later. - retain = lines.select { |line| MRI_TEST_RETAG_RETAIN_PATTERNS.any? { |pattern| line =~ pattern } } + # tests as excluded and manually inspect them later. We need to be careful that we're not checking for our + # retains pattern on the test name. Thus, we limit our checks to either the exclusion reason string or a + # conditional guard that applies to the exclusion. + retain = lines.select do |line| + reason_or_guard = line.split(',', 2).last + + MRI_TEST_RETAG_RETAIN_PATTERNS.any? { |pattern| reason_or_guard =~ pattern } + end puts 'Retaining:' puts retain