ruby / ruby/rdoc

Linear performance test times out intermittently on JRuby

Open
#1,310 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
930
Forks
465
Avg merge
3d 10h
Merged PRs (30d)
27

Description

The linear timing test "test_read_directive_linear_performance" occasionally times out on JRuby. This does not likely indicate a failure to run the example in linear time as much as it reflects a sensitivity to very short timeouts. Until we fully understand why this test times out intermittently, I will omit it on JRuby.

The timeout failure produces the following output in CI:

Error: test_read_directive_linear_performance(TestRDocParserRuby): Timeout::Error: [100]: in 0.01s (tmin: 3.2501000021056825e-05, tmax: 7.660400001441303e-05, tbase: 1/1000)
org/jruby/ext/thread/Mutex.java:119:in `lock'
org/jruby/ext/thread/Mutex.java:181:in `synchronize'
/home/runner/.rubies/jruby-head/lib/ruby/stdlib/timeout.rb:93:in `finished'
/home/runner/.rubies/jruby-head/lib/ruby/stdlib/timeout.rb:191:in `block in timeout'
/home/runner/.rubies/jruby-head/lib/ruby/stdlib/timeout.rb:196:in `timeout'
/home/runner/work/rdoc/rdoc/vendor/bundle/jruby/3.1.0/gems/test-unit-ruby-core-1.0.6/lib/core_assertions.rb:836:in `block in assert_linear_performance'
org/jruby/RubyArray.java:2009:in `each'
/home/runner/work/rdoc/rdoc/vendor/bundle/jruby/3.1.0/gems/test-unit-ruby-core-1.0.6/lib/core_assertions.rb:831:in `assert_linear_performance'
/home/runner/work/rdoc/rdoc/test/rdoc/test_rdoc_parser_ruby.rb:[33](https://github.com/ruby/rdoc/actions/runs/13748754286/job/38447004956#step:5:34)87:in `test_read_directive_linear_performance'
     3384: 
     3385:   def test_read_directive_linear_performance
     3386:     pre = ->(i) {util_parser '# ' + '0'*i + '=000:'}
  => 3387:     assert_linear_performance((1..5).map{|i|10**i}, pre: pre) do |parser|
     3388:       assert_nil parser.read_directive []
     3389:     end
     3390:   end
org/jruby/RubyKernel.java:1426:in `catch'
org/jruby/RubyKernel.java:1421:in `catch'
org/jruby/RubyArray.java:2009:in `each'
org/jruby/RubyArray.java:2009:in `each'
org/jruby/RubyArray.java:2009:in `each'
org/jruby/RubyKernel.java:1426:in `catch'
org/jruby/RubyKernel.java:1421:in `catch'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/rdoc/test_rdoc_parser_ruby.rb and test_read_directive_linear_performance, then reproduce the timeout in JRuby CI using the reported stack trace. Determine whether the test needs a JRuby-specific handling or whether the timeout exposes a real parser problem; done means the test runs reliably without masking regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
performance, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.