Skip to content

Possible regression in JRuby v9.4.0.0 #7492

@floehopper

Description

@floehopper

Environment Information

  • JRuby version string for scenario where Mocha tests pass: jruby 9.3.9.0 (2.6.8) 2022-10-24 537cd1f8bc OpenJDK 64-Bit Server VM 25.352-b08 on 1.8.0_352-b08 +jit [x86_64-linux]
  • JRuby version string for scenario where some Mocha tests fail: jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f OpenJDK 64-Bit Server VM 25.352-b08 on 1.8.0_352-b08 +jit [x86_64-linux]
  • Mocha gem test suite running on CircleCI: passing build; failing build

Expected Behavior

The Mocha test suite passes.

Actual Behavior

A number of tests relating to keyword arguments fail in the Mocha test suite...

  1) Failure:
KeywordArgumentMatchingTest#test_should_match_hash_parameter_with_keyword_args [/root/project/test/acceptance/keyword_argument_matching_test.rb:32]:
Test failed unexpectedly with message: [#<MinitestResult::Failure:0x36c54a56 @failure=#<Minitest::Assertion: Expected "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:22:in `block in test_me' expected keyword arguments (:key => 42), but received positional hash ({:key => 42}). These will stop matching when strict keyword argument matching is enabled. See the documentation for Mocha::Configuration#strict_keyword_argument_matching=." to include "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:22:in `block in test_should_match_hash_parameter_with_keyword_args' expected keyword arguments (:key => 42)".>>]

  2) Failure:
KeywordArgumentMatchingTest#test_should_match_hash_parameter_with_splatted_keyword_args [/root/project/test/acceptance/keyword_argument_matching_test.rb:62]:
Test failed unexpectedly with message: [#<MinitestResult::Failure:0x15fc442 @failure=#<Minitest::Assertion: Expected "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:52:in `block in test_me' expected keyword arguments (:key => 42), but received positional hash ({:key => 42}). These will stop matching when strict keyword argument matching is enabled. See the documentation for Mocha::Configuration#strict_keyword_argument_matching=." to include "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:52:in `block in test_should_match_hash_parameter_with_splatted_keyword_args' expected keyword arguments (:key => 42)".>>]

  3) Failure:
KeywordArgumentMatchingTest#test_should_match_positional_and_keyword_args_with_last_positional_hash [/root/project/test/acceptance/keyword_argument_matching_test.rb:110]:
Test failed unexpectedly with message: [#<MinitestResult::Failure:0x11ce2e22 @failure=#<Minitest::Assertion: Expected "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:100:in `block in test_me' expected positional hash ({:key => 42}), but received keyword arguments (:key => 42). These will stop matching when strict keyword argument matching is enabled. See the documentation for Mocha::Configuration#strict_keyword_argument_matching=." to include "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:100:in `block in test_should_match_positional_and_keyword_args_with_last_positional_hash' expected positional hash ({:key => 42})".>>]

  4) Failure:
KeywordArgumentMatchingTest#test_should_match_last_positional_hash_with_keyword_args [/root/project/test/acceptance/keyword_argument_matching_test.rb:140]:
Test failed unexpectedly with message: [#<MinitestResult::Failure:0x6f95cd51 @failure=#<Minitest::Assertion: Expected "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:130:in `block in test_me' expected keyword arguments (:key => 42), but received positional hash ({:key => 42}). These will stop matching when strict keyword argument matching is enabled. See the documentation for Mocha::Configuration#strict_keyword_argument_matching=." to include "Expectation defined at /root/project/test/acceptance/keyword_argument_matching_test.rb:130:in `block in test_should_match_last_positional_hash_with_keyword_args' expected keyword arguments (:key => 42)".>>]

I'm pretty confident these were passing before the JRuby version bump from v9.3.9.0 -> v9.4.0.0. I haven't had time to work out whether something is wrong with the Mocha implementation, but I wanted to give you an early heads-up that something might be amiss with JRuby.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions