summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-09-09ZJIT: Optimize `ObjToString` with type guards (#14469)André Luiz Tiago Soares
* failing test for ObjToString optimization with GuardType * profile ObjToString receiver and rewrite with guard * adjust integration tests for objtostring type guard optimization * Implement new GuardTypeNot HIR; objtostring sends to_s directly on profiled nonstrings * codegen for GuardTypeNot * typo fixes * better name for tests; fix side exit reason for GuardTypeNot * revert accidental change * make bindgen * Fix is_string to identify subclasses of String; fix codegen for identifying if val is String
2025-09-08ZJIT: Add RubyVM::ZJIT.reset_stats! method (GH-14479)Randy Stauner
This allows for more precise tracking of stats programmatically which is particularly useful for our nightly benchmarking suite. - Define rust function - Expose to C - Wrap with Ruby API - Add a test
2025-09-08ZJIT: Fix backtraces on opt_new (#14461)Takashi Kokubun
2025-09-08ZJIT: Add --zjit-stats=quiet option to collect stats without printing (#14467)Randy Stauner
Similar to YJIT's --yjit-stats=quiet, this option allows ZJIT to collect statistics and make them available via the Ruby API without printing them at exit. This is useful for programmatic access to stats without the output noise. - Added print_stats field to Options struct - Modified option parsing to support --zjit-stats=quiet - Added rb_zjit_print_stats_p primitive to check if stats should be printed - Updated zjit.rb to only register at_exit handler when print_stats is true - Update the help text shown by `ruby --help` to indicate that --zjit-stats now accepts an optional =quiet parameter. - Added test for --zjit-stats=quiet option
2025-09-08Align the conditions for did_you_meanNobuyoshi Nakada
Probably due to the testing order, sometimes it looks like that `Gem::UnknownCommandError` happens to be used without registered in `DidYouMean`.
2025-09-08Remove debug codeNobuyoshi Nakada
* Revert "Debug: More inspections" e5a6e952467eef5444eaf63b77d8c91aa367d4de. * Revert "Debug for sporadical failures on RubyCI" 7cafc61e7df044644f47937694c46835c316e86b.
2025-09-08Debug: More inspectionsNobuyoshi Nakada
2025-09-08Debug for sporadical failures on RubyCINobuyoshi Nakada
2025-09-08Allow IO#each_codepoint to work with unetc even when encoding conversion activeYO4
Using IO#each_codepoint together with IO#ungetc causes an unwanted exception when encoding conversion is active. C:\>ruby -e "open('NUL', 'rt') { |f| f.ungetc('aa'); f.each_codepoint { |c| p c }}" 97 -e:1:in 'IO#each_codepoint': byte oriented read for character buffered IO (IOError) from -e:1:in 'block in <main>' from -e:1:in 'Kernel#open' from -e:1:in '<main>' Fixes [Bug #21131]
2025-09-07Make invalid & operator type error message consistent with */**Jeremy Evans
If #to_proc is defined, this uses the following error message format, matching the error message format used for * when to_a returns non-Array and for ** when to_hash returns non-Hash: ``` can't convert ClassName to Proc (ClassName#to_proc gives OtherClassName) ``` If #to_proc is not defined, this uses the following error message format, matching the error message format used when ** is called on a non-Hash not implementing to_hash. ``` no implicit conversion of ClassName into Proc ``` There isn't a similar error for * when called on a non-Array not implementing to_a, as Ruby does not raise for that case. Fixes [Bug #21563]
2025-09-06Increase the rehearsal countNobuyoshi Nakada
2025-09-05ZJIT: Fix tests for ZJIT (#14460)Takashi Kokubun
2025-09-05test_gem_command_manager.rb: Fix the environment variableTakashi Kokubun
The previous one failed: https://github.com/ruby/ruby/actions/runs/17504307509/job/49724437021 $GITHUB_ACTION_REPOSITORY points to the owner of the action, so it might not be ruby/ruby.
2025-09-05test_gem_command_manager.rb: Skip an unstable test for ruby/rubyTakashi Kokubun
This fails way too often these days, probably since https://github.com/rubygems/rubygems/pull/8948. To make sure we can merge ruby/ruby PRs, we need this to not fail randomly.
2025-09-05ZJIT: Stop optimizing toplevel locals (#14458)Takashi Kokubun
2025-09-05ZJIT: Invalidate local variables on EP escape (#14448)Takashi Kokubun
2025-09-05ZJIT: Remove unneeded tracing and thread test exclusions (#14453)Stan Lo
2025-09-05[rubygems/rubygems] Add gem sources --prepend and --append for finer source ↵Martin Emde
control --append adds a source to the end, moving it to the end if it already exists. --prepend adds or moves a source to the beginning. This allows idempotent sorting of gem sources without removing and adding. https://github.com/rubygems/rubygems/commit/d9a0567c65
2025-09-05[rubygems/rubygems] Fix "did you mean" suggestions for unknown commandsDavid Rodríguez
Since Ruby 3.4.5, which ships with did_you_mean-2.0.0, RubyGems no longer gives "did you mean" suggestions for unknown commands. This is because did_you_mean-2.0.0 completely removed the SPELL_CHECKERS constant, and attaching "did you mean" to `Gem::UnknownCommandError` errors required this constant to be defined. The fix is to remove conditions on the `SPELL_CHECKERS` constant. https://github.com/rubygems/rubygems/commit/9287cd80ed
2025-09-04ZJIT: Compile invokesuper with dynamic dispatch (#14444)Takashi Kokubun
Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
2025-09-04ZJIT: Add patchpoint for TracePoint (#14420)Stan Lo
ZJIT: Add patchpoint for TracePoint activation Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2025-09-04ZJIT: Support compiling ISEQs for opt_pc = 0 (#14441)Takashi Kokubun
* ZJIT: Support compiling ISEQs for opt_pc = 0 * Test send with optional arguments
2025-09-03Revert "test_gc.rb: Attempt to stabilize test_interrupt_in_finalizer"Takashi Kokubun
This reverts commit c1c0b32445c66e343c136faa28d7a0f0f46d96a2. This test is clearly not reliable: https://github.com/ruby/ruby/actions/runs/17446920961/job/49543543423 I want to skip this unstable test on GitHub Actions to make sure this test doesn't prevent PRs from getting merged. We can continue to monitor the state of this test on RubyCI and ci.rvm.jp.
2025-09-03ZJIT: Handle `opt_case_dispatch` insn (#14433)Stan Lo
ZJIT: Handle opt_case_dispatch insn
2025-09-03Use Time.new because JSON.unsafe_load losts fractions of a second andHiroshi SHIBATA
JSON.unsafe_load with Time object returns String ``` 1) Failure: JSONCommonInterfaceTest#test_unsafe_load_default_options [/path/to/ruby/test/json/json_common_interface_test.rb:230]: <2025-09-03 14:28:31.293635 +0200> expected but was <"2025-09-03 14:28:31 +0200">. ```
2025-09-03[ruby/json] Added testing for JSON.unsafe_load. Fixes NoMethodErrorRobin Miller
when passing proc to JSON.unsafe_load, matching the changes made in https://github.com/ruby/json/commit/73d2137fd3ad. https://github.com/ruby/json/commit/77292cbc9b
2025-09-03[ruby/json] Ensure the SWAR encoder in the java extension checks every byte.Scott Myron
https://github.com/ruby/json/commit/9ebe105144
2025-09-03[rubygems/rubygems] Bump the rb-sys group across 2 directories with 1 updatedependabot[bot]
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys). Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys). Updates `rb-sys` from 0.9.116 to 0.9.117 - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.116...v0.9.117) Updates `rb-sys` from 0.9.116 to 0.9.117 - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.116...v0.9.117) --- updated-dependencies: - dependency-name: rb-sys dependency-version: 0.9.117 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rb-sys - dependency-name: rb-sys dependency-version: 0.9.117 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rb-sys ... Signed-off-by: dependabot[bot] <support@github.com> https://github.com/rubygems/rubygems/commit/02c46294ec
2025-09-03[rubygems/rubygems] Warn when trying to remove a default source that's the ↵David Rodríguez
only configured sources https://github.com/rubygems/rubygems/commit/ef78de5b69
2025-09-03[rubygems/rubygems] Improve error output when removing a source through `gem ↵David Rodríguez
sources` "Not present in cache" felt a bit unclear, so I changed the reason to: "No configured sources" or "source not present in configured sources", also pointing explicitly to the configuration file where RubyGems is looking for the source to be removed. https://github.com/rubygems/rubygems/commit/2bae554eff
2025-09-03[rubygems/rubygems] Change more source tests to act on configured sourcesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7f0c90b3f0
2025-09-03[rubygems/rubygems] Fix trailing slashes not considered when removing sourcesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d86d9b3596
2025-09-03[rubygems/rubygems] Change trailing slash test to not work on default sourcesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b2daf4707b
2025-09-03[rubygems/rubygems] Refactor duplicated test logicDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6fcc20f884
2025-09-03[rubygems/rubygems] Simplify test for trailing slash handling when adding ↵David Rodríguez
sources https://github.com/rubygems/rubygems/commit/9c9fd4799f
2025-09-03[rubygems/rubygems] Add missing `gem sources --remove` testDavid Rodríguez
https://github.com/rubygems/rubygems/commit/1f779adc47
2025-09-03[rubygems/rubygems] Let `gem sources` be more clear about which sources it's ↵David Rodríguez
displaying https://github.com/rubygems/rubygems/commit/2afefa4a48
2025-09-03[rubygems/rubygems] Improve source list management testingDavid Rodríguez
This approach better simulate that ["http://gems.example.com/"] is the default list of sources, rather than ["https://rubygems.org/"]. https://github.com/rubygems/rubygems/commit/55130c259a
2025-09-02test_io_wait.rb: Increase a timeout for a flaky testTakashi Kokubun
like 68682a5d2b2 https://github.com/ruby/ruby/actions/runs/17417763247/job/49449895757?pr=14433
2025-09-02ext/-test-/tracepoint/gc_hook.c: Fix GC safety issueAlan Wu
TestTracepointObj#test_teardown_with_active_GC_end_hook was failing on some platforms due to a Proc that is not marked being passed around. Neither rb_tracepoint_new() nor rb_postponed_job_preregister() promise to mark their callback `void *data`. https://rubyci.s3.amazonaws.com/osx1300arm/ruby-master/log/20250902T154504Z.fail.html.gz Add a GC.start to make the test a better detector for this safety issue and fix it by getting the Proc from an ivar on the rooted module.
2025-09-02ZJIT: Remove unneeded test exclusions (#14430)Stan Lo
2025-09-02test_gc.rb: Attempt to stabilize test_interrupt_in_finalizerTakashi Kokubun
This fails way too often across many environments. I don't think this test is healthy. https://github.com/ruby/ruby/actions/runs/17343611722/job/49240735401 Before we give up on it, let me see if this helps.
2025-09-02test_settracefunc.rb: Increase a timeoutTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/17413734881/job/49436975287
2025-09-02ZJIT: Clear jit entry from iseqs after TracePoint activation (#14407)Stan Lo
ZJIT: Remove JITed code after TracePoint is enabled
2025-09-02ZJIT: NewRangeFixnum instruction (#14409)André Luiz Tiago Soares
* Failing optimization tests for NewRangeFixnum * NewRangeFixnum general idea * Use gen_prepare_call_with_gc on gen_new_range_fixnum; add additional hir tests * Remove unused NewRange rewrite trigger when neither range is Fixnum literal * Remove misleading 'profiled' name in range optimization tests * Adjustments as per review comments * Include new_range_fixnum tests * remove non-ASCII character from comments as per PR review * remove non-ASCII character from comments as per PR review
2025-09-02test_socket.rb: Permit ProxyError for WindowsTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/17410747983/job/49427074277
2025-09-02test_thread_cv.rb: Increase a timeout for a thread testTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/17410747983/job/49427074277
2025-09-02test_transcode.rb: Increase a timeout for Ractor testsTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/17408924679/job/49420774667
2025-08-30Initialize class dup/clone before calling initialize_dup/initialize_cloneJeremy Evans
Previously, you could override the class initialize_dup/initialize_clone method and the class hierarchy would not be set correctly inside the method before calling super. This removes Module#initialize_copy, and instead makes Object#dup/clone call the underlying C function (rb_mod_init_copy) before calling the appropriate initialize_dup/initialize_clone method. This results in the following fixes: * The appropriate initialize_dup method is called (dup on a class will respect superclass initialize_dup). * Inside class initialize_dup/initialize_clone/initialize_copy, class ancestor hierarchy is correct. * Calling singleton_class inside initialize_dup no longer raises a TypeError later in dup. * Calling singleton_class.ancestors inside initialize_dup no longer results in missing ancestors. Fixes [Bug #21538]
2025-08-30Add NODE SCLASS locationsS-H-GAMELINKS
Add locations to struct `RNode_SCLASS`. memo: ``` @ ProgramNode (location: (1,0)-(1,18)) +-- locals: [] +-- statements: @ StatementsNode (location: (1,0)-(1,18)) +-- body: (length: 1) +-- @ SingletonClassNode (location: (1,0)-(1,18)) +-- locals: [] +-- class_keyword_loc: (1,0)-(1,5) = "class" +-- operator_loc: (1,6)-(1,8) = "<<" +-- expression: | @ SelfNode (location: (1,9)-(1,13)) +-- body: nil +-- end_keyword_loc: (1,15)-(1,18) = "end" ```