Skip to content

Flaky test: test_git_clone.rb global timeout test fails intermittently on JRuby #847

@jcouball

Description

@jcouball

Description

The test test: global timmeout(TestGitClone::Git.clone with timeouts) in tests/units/test_git_clone.rb fails intermittently on JRuby.

Test Details

  • File: tests/units/test_git_clone.rb (around line 16)
  • Test name: test: global timmeout(TestGitClone::Git.clone with timeouts)
  • Platform: JRuby 10.0.0.1 (observed in CI)
  • Expected: Git::TimeoutError exception when cloning with extremely small timeout (0.00001 seconds)
  • Actual: No exception raised, test fails

Error Message

Failure: test: global timmeout(TestGitClone::Git.clone with timeouts): <Git::TimeoutError> exception was expected but none was thrown.
/home/runner/work/ruby-git/ruby-git/tests/units/test_git_clone.rb:16:in 'block in TestGitClone'

Reproduction

This test is timing-dependent and fails intermittently. It was observed to:

Root Cause

JRuby has different subprocess handling and timing characteristics compared to MRI Ruby. The extremely small timeout value (10 microseconds) creates race conditions in JRuby's process execution.

Proposed Solutions

  1. Skip this specific test on JRuby platform
  2. Increase the timeout slightly while keeping it low enough to test the feature
  3. Add retry logic for timing-sensitive tests on JRuby
  4. Mark as known flake and document expected intermittent failures

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions