Skip to content

Commit 03e7968

Browse files
committed
test: skip CSS tokenizer benchmarks on JRuby
JRuby's JIT warmup variance makes per-call timings too noisy for the R**2 >= 0.99 linearity assertion. Observed CI failures with R**2 around 0.94-0.97 even though the regex itself is unchanged between engines. The ReDoS property is determined by the regex, not the engine (Joni and Onigmo implement the same matching semantics), so MRI coverage is sufficient evidence the fixes hold. (cherry picked from commit 760bde0)
1 parent b984b7e commit 03e7968

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/css/bench_tokenizer.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
require "timeout"
55

66
class TestBenchCSSTokenizer < Nokogiri::TestBenchmark
7+
# JRuby's JIT warmup makes per-call timings too noisy for an R**2 fit;
8+
# the ReDoS property is a regex property, not an engine one, so MRI
9+
# coverage is sufficient.
10+
before { skip("benchmarks are too noisy under JRuby JIT") if Nokogiri.jruby? }
11+
712
# GHSA-c4rq-3m3g-8wgx: ambiguous regex in the STRING rule backtracks
813
# exponentially on unterminated `[foo="\a\a\a..."` input. Each sample
914
# repeats the parse to average out per-call jitter.

0 commit comments

Comments
 (0)