aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/irb] Fixed string escaping omissionsima1zumi2023-06-051-0/+1
| | | | | | | (https://github.com/ruby/irb/pull/599) I received a `RegexpError` when I typed `::Array[`. ::Array[/Users/mi/ghq/github.com/ruby/irb/lib/irb/completion.rb:236:in `retrieve_completion_data': premature end of char-class: /^Array[/ (RegexpError)
* Revert "Revert "Fix cvar caching when class is cloned""eileencodes2023-06-051-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 10621f7cb9a0c70e568f89cce47a02e878af6778. This was reverted because the gc integrity build started failing. We have figured out a fix so I'm reopening the PR. Original commit message: Fix cvar caching when class is cloned The class variable cache that was added in ruby#4544 changed the behavior of class variables on cloned classes. As reported when a class is cloned AND a class variable was set, and the class variable was read from the original class, reading a class variable from the cloned class would return the value from the original class. This was happening because the IC (inline cache) is stored on the ISEQ which is shared between the original and cloned class, therefore they share the cache too. To fix this we are now storing the `cref` in the cache so that we can check if it's equal to the current `cref`. If it's different we don't want to read from the cache. If it's the same we do. Cloned classes don't share the same cref with their original class. This will need to be backported to 3.1 in addition to 3.2 since the bug exists in both versions. We also added a marking function which was missing. Fixes [Bug #19379] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* [rubygems/rubygems] Try again with ↵Hiroshi SHIBATA2023-06-051-0/+5
| | | | | | https://github.com/rubygems/rubygems/pull/6693 https://github.com/rubygems/rubygems/commit/73c0d5f059
* [ruby/singleton] Simplify implementation of `Singleton#instance`.Daniel Pepper2023-06-051-0/+21
| | | | | | (https://github.com/ruby/singleton/pull/9) - Add more tests to cover rails' usage.
* [ruby/singleton] Revert "Simplify the implementationHiroshi SHIBATA2023-06-051-11/+0
| | | | | | | | | | (https://github.com/ruby/singleton/pull/7)" This reverts commit https://github.com/ruby/singleton/commit/545b6b61a40d. This change break Rails CI: https://bugs.ruby-lang.org/issues/19711 https://github.com/ruby/singleton/commit/911531d508
* Attrset name is not allowed as an attributeNobuyoshi Nakada2023-06-031-0/+1
|
* Fix `Thread#join(timeout)` when running inside the fiber scheduler. (#7903)Samuel Williams2023-06-031-0/+22
|
* [ruby/rdoc] Auto-correct trailing new linesVinicius Stock2023-06-0335-35/+0
| | | | https://github.com/ruby/rdoc/commit/4b68c0728a
* [ruby/singleton] Simplify the implementationDaniel Pepper2023-06-031-0/+11
| | | | | | (https://github.com/ruby/singleton/pull/7) Remove `__init__` and move logic to `included`.
* Stabilize test_latest_gc_info_need_major_byJean Boussier2023-06-021-1/+1
| | | | | | | | | | | Fix: ``` 1) Failure: TestGc#test_latest_gc_info_need_major_by [/home/runner/work/ruby/ruby/src/test/ruby/test_gc.rb:266]: <nil> expected to not be nil. ``` `GC.stat(:major_gc_count)` can be bumped while `GC.latest_gc_info(:need_major_by)` is still nil.
* [ruby/irb] Require `test/lib` helpers from main test helperStan Lo2023-06-022-5/+1
| | | | | | (https://github.com/ruby/irb/pull/595) Because they are handled differently in `ruby/irb` and `ruby/ruby`.
* Revert "Fix cvar caching when class is cloned"Aaron Patterson2023-06-011-13/+0
| | | | This reverts commit 77d1b082470790c17c24a2f406b4fec5d522636b.
* [ruby/irb] Improve debug command testsStan Lo2023-06-011-8/+2
| | | | | | | | | | | | (https://github.com/ruby/irb/pull/594) * Use require_relative for envutil.rb Requiring test helper files with `require_relative` allows running the tests with `ruby -Itest test/irb/test_debug_cmd.rb` without having to set up the load path. * Replace reline hack with TERM=dumb
* Fix cvar caching when class is clonedeileencodes2023-06-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | The class variable cache that was added in https://github.com/ruby/ruby/pull/4544 changed the behavior of class variables on cloned classes. As reported when a class is cloned AND a class variable was set, and the class variable was read from the original class, reading a class variable from the cloned class would return the value from the original class. This was happening because the IC (inline cache) is stored on the ISEQ which is shared between the original and cloned class, therefore they share the cache too. To fix this we are now storing the `cref` in the cache so that we can check if it's equal to the current `cref`. If it's different we don't want to read from the cache. If it's the same we do. Cloned classes don't share the same cref with their original class. This will need to be backported to 3.1 in addition to 3.2 since the bug exists in both versions. We also added a marking function which was missing. Fixes [Bug #19379] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* More debug code to GC compaction testPeter Zhu2023-05-311-1/+3
|
* Fix flaky test in test_objspace.rbPeter Zhu2023-05-311-0/+2
| | | | | Ensure that the frozen string is promoted to the old generation by running the GC 4 times.
* Add debug code to GC compaction testPeter Zhu2023-05-311-2/+4
| | | | This test is flaky on some CI systems.
* Merge RubyGems/Bundler master from 4076391fce5847689bf2ec402b17133fe4e32285Hiroshi SHIBATA2023-05-303-8/+3
|
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-05-292-5/+5
| | | | | | | | | | | | | | | Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.77 to 0.9.78. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.77...v0.9.78) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* [ruby/cgi] Add TruffleRuby support and add it in CIBenoit Daloze2023-05-291-2/+2
| | | | https://github.com/ruby/cgi/commit/1240fec9c9
* mkmf: Add the extra option `--with-verbose` to enable verbose mode. (#7863)Jun Aruga2023-05-294-12/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is to add an extra option to enable verbose mode (V=1) in the generated `Makefile` at runtime of the Ruby to print compiler command lines by the commands below when building native extensions. It's possible to enable the verbose mode by setting the environment variable `MAKEFLAGS="V=1"`[1] implemented in GNU make. However, I wanted to make a consistent user-interface not depending on the specific make's implementation. ``` $ ruby /path/to/extconf.rb -- --with-verbose ``` You can also add the extra option via rake-compiler gem. ``` $ rake compiler -- --with-verbose ``` If the extra option is not given, the value of the `RbConfig::CONFIG["MKMF_VERBOSE"]` enabled by the configure option below is used. ``` $ ./configure --enable-mkmf-verbose ``` For the unit tests, updated the following files. * The `test/mkmf/test_configuration.rb` was created to test the cases with the `configuration` method and this implementation. * Updated the `TestMkmf#assert_separately` to set the extra arguments in `test/mkmf/base.rb`. Updated tests using the `assert_separately`. * Added tests for `MakeMakefile#with_config` in the `test/mkmf/test_config.rb`. [1] https://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html Fixes [Bug #19695] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* [ruby/reline] Fix scrolldown condition in dialog renderingtomoya ishida2023-05-271-0/+19
| | | | | | (https://github.com/ruby/reline/pull/541) https://github.com/ruby/reline/commit/ad6faada3f
* [ruby/reline] Use appropriate dialog height and reduce screen pushuptomoya ishida2023-05-271-15/+21
| | | | | | | | | problem (https://github.com/ruby/reline/pull/542) * Provide preferred_dialog_height for dialog positioning * Fix rendering test
* Improve `read`/`write`/`pread`/`pwrite` consistency. (#7860)Samuel Williams2023-05-271-2/+2
| | | | | | | * Documentation consistency. * Improve consistency of `pread`/`pwrite` implementation when given length. * Remove HAVE_PREAD / HAVE_PWRITE - it is no longer optional.
* Remvoe very high timeout on test_race_gets_and_closeKJ Tsanaktsidis2023-05-261-1/+1
| | | | | This test should be fixed and fast now because the closing thread sleeps appropriately waiting for the file descriptor to be unused.
* Remove excessive timeout on test_wait_exception for FreeBSDKJ Tsanaktsidis2023-05-261-1/+0
| | | | This should now be fixed by the previous commit.
* [rubygems/rubygems] Load plugin immediatelySutou Kouhei2023-05-255-8/+63
| | | | | | | | | | | | | | | We can install RubyGems plugin by "gem install XXX". The installed plugin is used from the NEXT "gem ...". For example, "gem install gem-src kaminari" doesn't use gem-src plugin for kaminari. "gem install gem-src && gem install kaminari" uses gem-src plugin for kaminari. How about loading a plugin immediately when the plugin is installed? If this proposal is implemented, "gem install gem-src kaminari" works like "gem install gem-src && gem install kaminari". https://github.com/rubygems/rubygems/commit/4917d96f4c
* Don't immediately promote children of old objectsPeter Zhu2023-05-251-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | [Feature #19678] References from an old object to a write barrier protected young object will not immediately promote the young object. Instead, the young object will age just like any other object, meaning that it has to survive three collections before being promoted to the old generation. References from an old object to a write barrier unprotected object will place the parent object in the remember set for marking during minor collections. This allows the child object to be reclaimed in minor collections at the cost of increased time for minor collections. On one of [Shopify's highest traffic Ruby apps, Storefront Renderer](https://shopify.engineering/how-shopify-reduced-storefront-response-times-rewrite), we saw significant improvements after deploying this feature in production. We compare the GC time and response time of web workers that have the original behaviour (non-experimental group) and this new behaviour (experimental group). We see that with this feature we spend significantly less time in the GC, 0.81x on average, 0.88x on p99, and 0.45x on p99.9. This translates to improvements in average response time (0.96x) and p99 response time (0.92x).
* [ruby/csv] Support RJIT (https://github.com/ruby/csv/pull/281)Nobuyoshi Nakada2023-05-251-8/+15
| | | | | | In Ruby 3.3, MJIT is replaced with RJIT. https://github.com/ruby/csv/commit/cc6b47a4a7
* [ruby/csv] test: rename Helper to CSVHelperLuke Gruber2023-05-256-6/+6
| | | | | | (https://github.com/ruby/csv/pull/278) Rename it so that in ruby/ruby, the generic name Helper is not used.
* Add REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIOPeter Zhu2023-05-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | [Feature #19571] This commit adds the environment variable `RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO` which is used to calculate the `remembered_wb_unprotected_objects_limit` using a ratio of `old_objects`. This should improve performance by reducing major GC because, in a major GC, we mark all of the old objects, so we should have more uncollectible WB unprotected objects before starting a major GC. The default has been set to 0.01 (1% of old objects). On one of [Shopify's highest traffic Ruby apps, Storefront Renderer](https://shopify.engineering/how-shopify-reduced-storefront-response-times-rewrite), we saw significant improvements after deploying this patch in production. In the graphs below, we have the `tuned` group which uses `RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO=0.01` (the default value), and an `untuned` group, which turns this feature off with `RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO=0`. We see that the tuned group spends significantly less time in GC, on average 0.67x of the time compared to the untuned group and 0.49x for p99. We see this improvement in GC time translate to improvements in response times. The average response time is now 0.96x of the time compared to the untuned group and 0.86x for p99. https://user-images.githubusercontent.com/15860699/229559078-e23e8ce4-5f1f-4a2f-b5ef-5769f92b8c70.png
* [ruby/racc] Add a newline at EOF [ci skip]Nobuyoshi Nakada2023-05-242-2/+2
| | | | https://github.com/ruby/racc/commit/8f1dab6759
* Improvements to `IO::Buffer` `read`/`write`/`pread`/`pwrite`. (#7826)Samuel Williams2023-05-241-7/+28
| | | - Fix IO::Buffer `read`/`write` to use a minimum length.
* [flori/json] Call `super` in `included` hookUfuk Kayserilioglu2023-05-241-0/+23
| | | | | | | | | | The C extension defines an `included` hook for the `JSON::Ext::Generator::GeneratorMethods::String` module but neglects to call `super` in the hook. This can break the functionality of various other code that rely on the fact that `included` on `Module` will always be called. https://github.com/flori/json/commit/cd8bbe56a3
* Fix crash when replacing ST hash with AR hashPeter Zhu2023-05-231-0/+10
| | | | | | | | | With VWA, AR hashes are much larger than ST hashes. Hash#replace attempts to directly copy the contents of AR hashes into ST hashes so there will be memory corruption caused by writing past the end of memory. This commit changes it so that if a ST hash is being replaced with an AR hash it will insert each element into the ST hash.
* [rubygems/rubygems] Remove forward slash in key regardless if it contains __Jenny Shen2023-05-231-4/+9
| | | | https://github.com/rubygems/rubygems/commit/33a02eec00
* [ruby/irb] Allow `show_source` for private methodsTSUYUSATO Kitsune2023-05-231-0/+41
| | | | | | | | | | | | | | | | (https://github.com/ruby/irb/pull/589) * Allow `show_source` for private methods Fix https://github.com/ruby/irb/pull/577 * Pend tests on TruffleRuby It seems `eval(..., __LINE__ + 1)` does not work. Other similar tests are also pended on TruffleRuby, so I think it is acceptable. * Use `private_method_defined?` instead of `defined?`
* Ensure producer threads do not start running earlyCharles Oliver Nutter2023-05-221-3/+10
| | | | | | | | | | | | | | | | | | | | This test caused issues occasionally on JRuby because it's possible for a producer thread to run to completion before the status checks begin. This results in Thread#status returning false and the =~ call triggering a warning (3.1) or error (3.2) and either emitting thousands of deprecation warnings or failing outright. The patch here introduces a mutex that remains locked until all producer threads are seen to have started. The lock is then released and the test proceeds. This prevents any producers from running to completion, which in turn prevents consumers running to completion, avoiding the warnings or error calling =~ on false. This patch also modifies the status checks to to_s the thread status, preventing any prematurely terminated threads from triggering similar deprecation warnings or missing method errors when =~ is called on nil.
* Revert "Apply timeout-scale to test_thr_kill." (#7838)Jun Aruga2023-05-221-1/+1
| | | | | | | | | | | | | | | This reverts commit bbbec4b87c1e66909f5bee9acd3e460b8c1ad663. Because the commit is a bug. The `apply_timeout_scale` to scale the timeout is called 2 times in the process. The `test/ruby/test_thread_queue.rb#test_thr_kill` is calling `EnvUtil.apply_timeout_scale`, and calling `tool/lib/core_assertions.rb#assert_normal_exit`. calling `tool/lib/envutil.rb#invoke_ruby` (`EnvUtil.invoke_ruby`) calling the `apply_timeout_scale`. ``` $ make test-all V=1 TESTS="-v test/ruby/test_thread_queue.rb -n TestThreadQueue#test_thr_kill --timeout-scale=2" ```
* Fix mutation on shared strings. (#7837)Samuel Williams2023-05-221-4/+0
|
* Allow the match cache optimization for atomic groups (#7804)TSUYUSATO Kitsune2023-05-221-0/+10
|
* Don't leak pipes. (#7820)Samuel Williams2023-05-221-1/+1
|
* Skip too-complex-shape test which is always flaky regardless JITNobuyoshi Nakada2023-05-211-3/+1
|
* [ruby/irb] Fix typo (https://github.com/ruby/irb/pull/587)ima1zumi2023-05-211-4/+4
| | | | | | | | | | | | | | * Fix typo * s/braking/breaking/g Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/irb/commit/5f8e69f5f2 Co-authored-by: Stan Lo <stan001212@gmail.com>
* Skip first if flaky [ci skip]Nobuyoshi Nakada2023-05-211-4/+6
|
* Set rlimit_nproc to 64 instead of 128 on OpenBSD for spawn_too_long_path testsJeremy Evans2023-05-201-1/+3
| | | | | This significantly reduces testing time, and may allow the test to pass before timeout in CI.
* [ruby/irb] Add assertion for dynamic_prompt's assertion executionStan Lo2023-05-201-0/+3
| | | | | | | | | | (https://github.com/ruby/irb/pull/586) Because the assertions for `dynamic_prompt` lives inside a block given to `RubyLex`, they could be skipped unnoticed if the setup is not correct. This commit adds a simple assertion to check if the block was actually executed.
* [ruby/irb] Fix dynamic_prompt test not executed, remove unnecessarytomoya ishida2023-05-201-2/+1
| | | | | | | set_input (https://github.com/ruby/irb/pull/585) https://github.com/ruby/irb/commit/b5f3efdcf0
* [ruby/irb] Simplify each_top_level_statementtomoya ishida2023-05-191-12/+7
| | | | | | | | | | | | | | | | | | | | | | (https://github.com/ruby/irb/pull/576) * Simplify each_top_level_statement, reduce instance vars * Update lib/irb/ruby-lex.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Remove unused ltype from TestRubyLex#check_state response * Remove unnecessary const path of TerminateLineInput * Combine duplicated code state check into method --------- https://github.com/ruby/irb/commit/172453cec4 Co-authored-by: Stan Lo <stan001212@gmail.com>
* The too-complex test isn't stablefor RJIT eitherTakashi Kokubun2023-05-191-1/+2
| | | | https://github.com/ruby/ruby/actions/runs/5020231516