summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-05-15Unskip the test skipped in #4173 (#7809)KJ Tsanaktsidis
This test was skipped 12 years ago because it was flaky on FreeBSD and OpenBSD. Since then, Ruby's SIGCHLD handling has been substantially re-written (mostly by Eric Wong @normalperson in 44fc3d08). These tests now in fact pass reliably on Ruby master on FreeBSD 13.2 and OpenBSD 7.3. I stress-tested the test_wait_and_sigchild test on my laptop by running four copies of the test in a loop on a 8-core VM; both by itself and also as part of the whole test_process.rb file. I did not see any failures. Let's unskip the test and close [#4173] out. I'll keep an eye out on Ruby CI for any flakes in this file on BSD after this gets merged, but if we don't see any I'm going to assume 44fc3d08 or related changes around that time accidently fixed this bug. It's also probably important to unskip this test so that if another attempt at removing the special SIGCHLD handling is made (like was reverted in https://github.com/ruby/ruby/pull/7517), we get signal if that breaks on FreeBSD/OpenBSD. [Fixes #4173] Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-15`rb_io_puts` should not write zero length strings. (#7806)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-05-14[Bug #19025] Numbered parameter names are always local variablesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7810
2023-05-10Prevent warning: assigned but unused variableYusuke Endoh
http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4 /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid ```
2023-05-10[Bug #19597] Freeze script nameNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7709
2023-05-10ext/readline is retiredHiroshi SHIBATA
2023-05-09Extract ext/readlineHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7781
2023-05-07[ruby/reline] Fix dialog corrupts rendering by pushing up input linetomoya ishida
too much (https://github.com/ruby/reline/pull/524) * Do not render dialog where it overflows screen * Dialog rendering should Scroll down only when needed * Refactor screen_y_range calculation Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/reline/commit/bc0e3d1310 Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-05-05Continue checking all gemspec files after errorsNobuyoshi Nakada
2023-05-05[ruby/uri] Define test cases as qualified class namesNobuyoshi Nakada
https://github.com/ruby/uri/commit/aaa22a2443
2023-05-05[ruby/uri] Increase repeat orders of magnitudeNobuyoshi Nakada
https://github.com/ruby/uri/commit/cfbeade935
2023-05-04test_default_gems.rb: Stop using `git ls-files`Nobuyoshi Nakada
Just validate syntax and the result class instead. Not only `git ls-files` doesn't make sence under ruby's repository, some gemspec files hardcode `2>/dev/null`, which doesn't work of course on other than Unix-like platforms. Notes: Merged: https://github.com/ruby/ruby/pull/7786
2023-05-04Define `RubyVM::Shape` dependent test only if availableNobuyoshi Nakada
2023-05-03Make the maximum shapes variation warning non-verboseJean Boussier
[Feature #19538] Since that category is not enabled by default, making it a verbose warning is redundant. Enabling performance warning should work with the default verbosity level. Notes: Merged: https://github.com/ruby/ruby/pull/7733
2023-05-02Allow EPIPE when the child process has exited before interruptNobuyoshi Nakada
2023-05-02[Bug #19619] Preserve numbered parameters contextNobuyoshi Nakada
Preserve numbered parameters context across method definitions
2023-05-02[ruby/rdoc] Fix references to nested label in table_of_contentsNobuyoshi Nakada
Fixes https://github.com/ruby/rdoc/pull/1000 https://github.com/ruby/rdoc/commit/291e2b7e8b
2023-05-02[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.74 to 0.9.75. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.74...v0.9.75) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01[ruby/reline] Rewrite dialog renderingtomoya ishida
(https://github.com/ruby/reline/pull/492) * Rewrite dialog rendering * Fix failing test of dialog with small screen * Add multiple-dialog rendering test * Add description comments for each part of render_dialog_changes
2023-05-01[Bug #19624] Hide internal IO for backquoteNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7776
2023-04-30Handle private AREF call in compile.cNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7775
2023-04-30Relax timeout limit for FreeBSD again [ci skip]Nobuyoshi Nakada
2023-04-29[ruby/rdoc] Fix polynominal backtrackingNobuyoshi Nakada
Fix https://github.com/ruby/rdoc/pull/995 https://github.com/ruby/rdoc/commit/1311ca8c50
2023-04-29[ruby/rdoc] Fix polynominal backtrackingNobuyoshi Nakada
Fix https://github.com/ruby/rdoc/pull/995 https://github.com/ruby/rdoc/commit/adfa7db5b9
2023-04-29Revert "[ruby/rdoc] Update test libraries from ruby/ruby 2023-04-29"Hiroshi SHIBATA
This reverts commit 966f0d91e2a86fa1347cdafbe1af47e7350aa4ca.
2023-04-28[ruby/rdoc] Update test libraries from ruby/ruby 2023-04-29Nobuyoshi Nakada
From https://github.com/ruby/ruby/commit/74028c210c23a13b3168886efcf837b4bf930468 https://github.com/ruby/rdoc/commit/badc518c57
2023-04-27[Bug #19611] Remove never-reachable branch in logical expressionNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7754
2023-04-26[ruby/irb] Use a more tolerant way to check Locale#find's returnStan Lo
path (https://github.com/ruby/irb/pull/572) https://github.com/ruby/irb/commit/0b648adf38
2023-04-26[ruby/irb] Add tests for Locale#find and Locale#loadStan Lo
(https://github.com/ruby/irb/pull/570) https://github.com/ruby/irb/commit/710d5b1af5
2023-04-26Wrap `undef_method :a` with `ensure`Gary Tou
2023-04-26Test: `defined?(super)` in `BasicObject` returns `nil`Gary Tou
Ensure it returns `nil` instead of segmentation faulting
2023-04-26[ruby/irb] Fix Locale's encoding lookup for Japanese encodingsStan Lo
(https://github.com/ruby/irb/pull/568) In https://github.com/ruby/irb/commit/3ee79e89adb8e21b63d796e53bcc86281685076d, `encoding_aliases.rb` was introduced to return the correct encoding object for `ujis` and `euc` encodings. However, the return value of `@@legacy_encoding_alias_map[@encoding_name]` is always overridden by a second look up with `Encoding.find(@encoding_name)`. So the logic didn't work as expected. This commit fixes the problem.
2023-04-26Revert "Temporary skipped failing assertions"Hiroshi SHIBATA
This reverts commit e7cdce83e8c8797c481ccb54c260c0db1e1afa7c.
2023-04-25[ruby/pp] Remove patch added for Ruby 2.6/JRuby 9.3Stan Lo
https://github.com/ruby/pp/commit/09dae96129
2023-04-25[ruby/pp] Skip certain tests for JRubyStan Lo
https://github.com/ruby/pp/commit/f7bde31ca9
2023-04-25Speed up calling iseq bmethodsJeremy Evans
Currently, bmethod arguments are copied from the VM stack to the C stack in vm_call_bmethod, then copied from the C stack to the VM stack later in invoke_iseq_block_from_c. This is inefficient. This adds vm_call_iseq_bmethod and vm_call_noniseq_bmethod. vm_call_iseq_bmethod is an optimized method that skips stack copies (though there is one copy to remove the receiver from the stack), and avoids calling vm_call_bmethod_body, rb_vm_invoke_bmethod, invoke_block_from_c_proc, invoke_iseq_block_from_c, and vm_yield_setup_args. Th vm_call_iseq_bmethod argument handling is similar to the way normal iseq methods are called, and allows for similar performance optimizations when using splats or keywords. However, even in the no argument case it's still significantly faster. A benchmark is added for bmethod calling. In my environment, it improves bmethod calling performance by 38-59% for simple bmethod calls, and up to 180% for bmethod calls passing literal keywords on both sides. ``` ./miniruby-iseq-bmethod: 18159792.6 i/s ./miniruby-m: 13174419.1 i/s - 1.38x slower bmethod_simple_1 ./miniruby-iseq-bmethod: 15890745.4 i/s ./miniruby-m: 10008972.7 i/s - 1.59x slower bmethod_simple_0_splat ./miniruby-iseq-bmethod: 13142804.3 i/s ./miniruby-m: 11168595.2 i/s - 1.18x slower bmethod_simple_1_splat ./miniruby-iseq-bmethod: 12375791.0 i/s ./miniruby-m: 8491140.1 i/s - 1.46x slower bmethod_no_splat ./miniruby-iseq-bmethod: 10151258.8 i/s ./miniruby-m: 8716664.1 i/s - 1.16x slower bmethod_0_splat ./miniruby-iseq-bmethod: 8138802.5 i/s ./miniruby-m: 7515600.2 i/s - 1.08x slower bmethod_1_splat ./miniruby-iseq-bmethod: 8028372.7 i/s ./miniruby-m: 5947658.6 i/s - 1.35x slower bmethod_10_splat ./miniruby-iseq-bmethod: 6953514.1 i/s ./miniruby-m: 4840132.9 i/s - 1.44x slower bmethod_100_splat ./miniruby-iseq-bmethod: 5287288.4 i/s ./miniruby-m: 2243218.4 i/s - 2.36x slower bmethod_kw ./miniruby-iseq-bmethod: 8931358.2 i/s ./miniruby-m: 3185818.6 i/s - 2.80x slower bmethod_no_kw ./miniruby-iseq-bmethod: 12281287.4 i/s ./miniruby-m: 10041727.9 i/s - 1.22x slower bmethod_kw_splat ./miniruby-iseq-bmethod: 5618956.8 i/s ./miniruby-m: 3657549.5 i/s - 1.54x slower ``` Notes: Merged: https://github.com/ruby/ruby/pull/7522
2023-04-25Generalize cfunc large array splat fix to fix many additional cases raising ↵Jeremy Evans
SystemStackError Originally, when 2e7bceb34ea858649e1f975a934ce1894d1f06a6 fixed cfuncs to no longer use the VM stack for large array splats, it was thought to have fully fixed Bug #4040, since the issue was fixed for methods defined in Ruby (iseqs) back in Ruby 2.2. After additional research, I determined that same issue affects almost all types of method calls, not just iseq and cfunc calls. There were two main types of remaining issues, important cases (where large array splat should work) and pedantic cases (where large array splat raised SystemStackError instead of ArgumentError). Important cases: ```ruby define_method(:a){|*a|} a(*1380888.times) def b(*a); end send(:b, *1380888.times) :b.to_proc.call(self, *1380888.times) def d; yield(*1380888.times) end d(&method(:b)) def self.method_missing(*a); end not_a_method(*1380888.times) ``` Pedantic cases: ```ruby def a; end a(*1380888.times) def b(_); end b(*1380888.times) def c(_=nil); end c(*1380888.times) c = Class.new do attr_accessor :a alias b a= end.new c.a(*1380888.times) c.b(*1380888.times) c = Struct.new(:a) do alias b a= end.new c.a(*1380888.times) c.b(*1380888.times) ``` This patch fixes all usage of CALLER_SETUP_ARG with splatting a large number of arguments, and required similar fixes to use a temporary hidden array in three other cases where the VM would use the VM stack for handling a large number of arguments. However, it is possible there may be additional cases where splatting a large number of arguments still causes a SystemStackError. This has a measurable performance impact, as it requires additional checks for a large number of arguments in many additional cases. This change is fairly invasive, as there were many different VM functions that needed to be modified to support this. To avoid too much API change, I modified struct rb_calling_info to add a heap_argv member for storing the array, so I would not have to thread it through many functions. This struct is always stack allocated, which helps ensure sure GC doesn't collect it early. Because of how invasive the changes are, and how rarely large arrays are actually splatted in Ruby code, the existing test/spec suites are not great at testing for correct behavior. To try to find and fix all issues, I tested this in CI with VM_ARGC_STACK_MAX to -1, ensuring that a temporary array is used for all array splat method calls. This was very helpful in finding breaking cases, especially ones involving flagged keyword hashes. Fixes [Bug #4040] Co-authored-by: Jimmy Miller <jimmy.miller@shopify.com> Notes: Merged: https://github.com/ruby/ruby/pull/7522
2023-04-25Temporary skipped failing assertionsHiroshi SHIBATA
2023-04-25[ruby/irb] Add tests for Locale classStan Lo
(https://github.com/ruby/irb/pull/566) https://github.com/ruby/irb/commit/df32e024be
2023-04-24[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.72 to 0.9.74. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.72...v0.9.74) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2023-04-24Allow anonymous memberless StructJeremy Evans
Previously, named memberless Structs were allowed, but anonymous memberless Structs were not. Fixes [Bug #19416] Notes: Merged: https://github.com/ruby/ruby/pull/7587
2023-04-24[ruby/irb] Simplify the help command's implementationStan Lo
(https://github.com/ruby/irb/pull/564) The current method-redefining approach brings little benefit, makes it harder to understand the code, and causes warnings like: > warning: method redefined; discarding old execute This patch simplifies it while displaying more helpful message when rdoc couldn't be loaded.
2023-04-24[ruby/irb] Filter out top-level methods when using `lsStan Lo
<Class/Module>` (https://github.com/ruby/irb/pull/562) Instead of always printing methods inherited from Class or Module, IRB by default should filter them out unless `<Class/Module>` is specified to be either of those.
2023-04-23Use UTF-8 encoding for literal extended regexps with UTF-8 characters in ↵Jeremy Evans
comments Fixes [Bug #19455] Notes: Merged: https://github.com/ruby/ruby/pull/7592
2023-04-20YJIT: invokesuper: Remove cme mid matching checkJohn Hawthorn
This check was introduced to match an assertion in the C YJIT when this was originally introduced. I don't believe it's necessary for correctness of the generated code. Co-authored-by: Adam Hess <HParker@github.com> Co-authored-by: Daniel Colson <danieljamescolson@gmail.com> Co-authored-by: Luan Vieira <luanzeba@github.com> Notes: Merged: https://github.com/ruby/ruby/pull/7740
2023-04-20[rubygems/rubygems] Revert "Bundler::YAMLSerializer.load couldn't raise ↵Hiroshi SHIBATA
error when invalid yaml was provided" This reverts commit https://github.com/rubygems/rubygems/commit/cfcfde04c783. https://github.com/rubygems/rubygems/commit/ac21ae7083
2023-04-19Hide Gem::MockGemUi. It's only used by testsHiroshi SHIBATA
2023-04-19[rubygems/rubygems] Added tests for load_with_rubygems_config_hash and ↵Hiroshi SHIBATA
dump_with_rubygems_yaml https://github.com/rubygems/rubygems/commit/0393f24119
2023-04-19[rubygems/rubygems] Bundler::YAMLSerializer.load couldn't raise error when ↵Hiroshi SHIBATA
invalid yaml was provided https://github.com/rubygems/rubygems/commit/cfcfde04c7
2023-04-19[rubygems/rubygems] Replaced Gem::ConfigFile.dump_with_rubygems_yaml for ↵Hiroshi SHIBATA
saveing configuration https://github.com/rubygems/rubygems/commit/46438e61cd