summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2 daysAdd a test backport missed at a10f7fac1fb1dcbdb1ae41137bd7294764a34793Takashi Kokubun
https://bugs.ruby-lang.org/issues/21831
3 daysSync Prism to 1.8.0Takashi Kokubun
3 daysmerge revision(s) 7e81bf5c0c8f43602e6d901f4253dca2f3d71745: [Backport #21812]Takashi Kokubun
[PATCH] Fix sleep spurious wakeup from sigchld (#15802) When sleeping with `sleep`, currently the main thread can get woken up from sigchld from any thread (subprocess exited). The timer thread wakes up the main thread when this happens, as it checks for signals. The main thread then executes the ruby sigchld handler if one is registered and is supposed to go back to sleep immediately. This is not ideal but it's the way it's worked for a while. In commit 8d8159e7d8 I added writes to `th->status` before and after `wait_running_turn` in `thread_sched_to_waiting_until_wakeup`, which is called from `sleep`. This is usually the right way to set the thread's status, but `sleep` is an exception because the writes to `th->status` are done in `sleep_forever`. There's a loop that checks `th->status` in `sleep_forever`. When the main thread got woken up from sigchld it saw the changed `th->status` and continued to run the main thread instead of going back to sleep. The following script shows the error. It was returning instead of sleeping forever. ```ruby t = Thread.new do sleep 0.3 `echo hello` # Spawns subprocess puts "Subprocess exited" end puts "Main thread sleeping..." result = sleep # Should block forever puts "sleep returned: #{result.inspect}" ``` Fixes [Bug #21812]
3 daysmerge revision(s) d7a6ff8224519005d2deeb3f4e98689a8a0835ad: [Backport #21819]Takashi Kokubun
[PATCH] [Bug #21819] Data objects without members should also be frozen
3 daysmerge revision(s) 19e539c9ee1701b34189fa0c1feb942adeb0e326: [Backport #21814]Takashi Kokubun
[PATCH] [Bug #21814] Fix negative bignum modulo If modulo is zero, do not apply bias even if the divisor is zero. `BIGNUM_POSITIVE_P` is true even on bignum zero.
7 daysFix incorrect bundled gems warning for hyphenated gem namesChris Hasiński
When requiring a file like "benchmark/ips", the warning system would incorrectly warn about the "benchmark" gem not being a default gem, even when the user has "benchmark-ips" (a separate third-party gem) in their Gemfile. The fix checks if a hyphenated version of the require path exists in the bundle specs before issuing a warning. For example, requiring "benchmark/ips" now checks for both "benchmark" and "benchmark-ips" in the Gemfile. [Bug #21828]
10 daysBox: allocate classes as boxable when it happens in the root boxSatoshi Tagomori
Without this change, classes (including iclass) are allocated as un-boxable classes after initializing user boxes (after starting script evaluation). Under this situation, iclasses are created as un-boxabled class when core modules are included by a class in the root box, then it causes problems because it's in the root box but it can't have multiple classexts. This change makes it possible to allocate boxable classes even after initializing user boxes. Classes create in the root box will be boxable, and those can have 2 or more classexts.
2025-12-24Revert "Add link to Ruby options doc in help text"NARUSE, Yui
This reverts commit 31ff07ed1eb05d01f7da3c017d542137a3db1e94. * Don't add a test which only runs on production release * https://github.com/ruby/actions/actions/runs/20486784889/job/58870959976 * Don't add a new line to `ruby --help` * https://github.com/ruby/ruby/pull/14142#issuecomment-3689829564
2025-12-24Revert "Extract `ruby_api_version_name`"NARUSE, Yui
This reverts commit 9b576cd6255aba97e5e2f55f4b09f00c7dd0e839.
2025-12-24Fix a fragile testNobuyoshi Nakada
`Dir.mktmpdir` concatenates a random base-36 number separated by "-", so may generate pathnames containing "-j2".
2025-12-24Prevent "warning: assigned but unused variable - it"Yusuke Endoh
2025-12-24Remove unintentional returnYusuke Endoh
2025-12-24Box: show the fully qualified URL of the Ruby::Box docSatoshi Tagomori
2025-12-24[Tests] Assert Module#set_temporary_name returns selfaguspe
The return value of Module#set_temporary_name was changed to return `self`, but the existing tests did not verify this.
2025-12-24Tidy up fiber scheduler tests.Samuel Williams
2025-12-24Fix flaky test.Samuel Williams
2025-12-23Box: split the test for CI timeoutsSatoshi Tagomori
2025-12-23Fix a fragile testNobuyoshi Nakada
`Dir.mktmpdir` concatenates a random base-36 number separated by "-", so may generate pathnames containing "-j4".
2025-12-23Merge RubyGems 4.0.3 and Bundler 4.0.3Hiroshi SHIBATA
2025-12-20Test test_remove_instance_variable_re_embed separatelyPeter Zhu
Shape tree pollution could cause this test to flake.
2025-12-20Change test to define ivars in initialize methodPeter Zhu
Defining ivars in initialize method guarantees the object to be embedded.
2025-12-20Exclude TestObjSpace#test_dump_objects_dumps_page_slot_sizes for MMTk [ci skip]Peter Zhu
2025-12-20Fix a fragile testNobuyoshi Nakada
`Dir.mktmpdir` concatenates a random base-36 number separated by "-", so may generate pathnames containing "-j4".
2025-12-20Revert pack/unpack support for LEB128Nobuyoshi Nakada
https://bugs.ruby-lang.org/issues/21785#note-10 > It is too late to introduce it in Ruby 4.0, let's aim for 4.1. This reverts commits: * d0b72429a93e54f1f956b4aedfc25c57dc7001aa Add support for signed and unsigned LEB128 to pack/unpack. * 68a900e30b4ca1537d7975c3a619fd94fca7b084 add news for pack / unpack directives
2025-12-20fix for a test case that depends on rbuf sizeYO4
2025-12-20skip TestFiberScheduler#test_io_write_on_flush because it makes GC.stat test ↵Koichi Sasada
fragile
2025-12-19Fiber scheduler: invoke `#io_write` hook on IO flush (#15609)Sharon Rosner
Previously, calling IO#flush or closing an IO with unflushed buffered writes would just invoke `#blocking_operation_wait` and flush the write buffer using a `write` syscall. This change adds flushing through the fiber scheduler by invoking the `#io_write` hook. * Prefer IO::Buffer#write in IOScheduler * Use Dir.tmpdir for test file * Correctly handle errors in io_flush_buffer_fiber_scheduler
2025-12-19Fix: Specifying 0 should cause an immediate timeout (#15641)Misaki Shioi
This change fixes a bug in which specifying 0 for timeout-related options (such as the `timeout` option of `Addrinfo.getaddrinfo`) incorrectly results in an infinite wait. (This change overwrites https://github.com/ruby/ruby/pull/15626 .)
2025-12-18[ruby/prism] Reject `p(p a, &block => value)` and similarEarlopain
Redo of https://github.com/ruby/prism/pull/3669 with more tests https://github.com/ruby/prism/commit/48b403ea79
2025-12-18[ruby/prism] Add Ruby 4.1 as a version specifierEarlopain
https://github.com/ruby/prism/commit/138db9ccc4
2025-12-18[ruby/prism] Fix assertions in location_test.rbBenoit Daloze
* assert_raise's 2nd argument is the failure message, shown when the expected exception is not raised. It's not the expected message. See https://github.com/test-unit/test-unit/issues/347 https://github.com/ruby/prism/commit/e3df994d47
2025-12-18Add support for signed and unsigned LEB128 to pack/unpack.Aaron Patterson
This commit adds a new pack format command `R` and `r` for unsigned and signed LEB128 encoding. The "r" mnemonic is because this is a "vaRiable" length encoding scheme. LEB128 is used in various formats including DWARF, WebAssembly, MQTT, and Protobuf. [Feature #21785]
2025-12-18make rb_singleton_class ractor safe (#15591)Luke Gruber
Since singleton classes are created lazily, we need to make sure that we lock around their creation. Unfortunately, that means we need to lock around every shareable object's call to `singleton_class`, including classes and modules.
2025-12-18[ruby/delegate] Reapply "Merge pull request #46 from byroot/use-forward-send"Hiroshi SHIBATA
This reverts commit https://github.com/ruby/delegate/commit/fc2bd0498af0. https://github.com/ruby/delegate/commit/7d5c1e0842 Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2025-12-18[ruby/delegate] Allow use of DelegateClass in ractorsLuke Gruber
Tempfile uses DelegateClass and Tempfile should be able to be used by different ractors. https://github.com/ruby/delegate/commit/cad194260b
2025-12-17ObjectSpace.{dump,dump_all,dump_shapes} needs vm barrier. (#15569)Luke Gruber
This allows these methods to be called from ractors. Add new exported function `rb_vm_lock_with_barrier()` that requires users to include "vm_sync.h"
2025-12-17[ruby/error_highlight] Show no message when failing to get caller/callee ↵Yusuke Endoh
snippets Even with Ruby 4.0, snippets is not always available, such as in irb by default. It would be better to just say nothing than to show a confusing message. https://github.com/ruby/error_highlight/commit/ef80ce73a1
2025-12-17Revert the default size of Enumerator::Producer to infinityAkinori Musha
[Bug #21780]
2025-12-17Revert the override of Enumerator#to_set that performed size checksAkinori Musha
[Bug #21780]
2025-12-17[ruby/net-http] Freeze more constants for Ractor compatibilityKazuki Yamaguchi
Freeze Net::HTTP::SSL_ATTRIBUTES and IDEMPOTENT_METHODS_. Both constants have been marked as :nodoc:. Together with https://github.com/ruby/openssl/issues/521, this enables HTTPS clients in non-main Ractors on Ruby 4.0. https://github.com/ruby/net-http/commit/f24b3b358b
2025-12-17`Socket.tcp` and `TCPSocket.new` raises `IO::TiemoutError` with user ↵Misaki Shioi
specified timeout (#15602) * `Socket.tcp` and `TCPSocket.new` raises `IO::TiemoutError` with user specified timeout In https://github.com/ruby/ruby/pull/11880, `rsock_connect()` was changed to raise `IO::TimeoutError` when a user-specified timeout occurs. However, when `TCPSocket.new` attempts to connect to multiple destinations, it does not use `rsock_connect()`, and instead raises `Errno::ETIMEDOUT` on timeout. As a result, the exception class raised on timeout could differ depending on whether there were multiple destinations or not. To align this behavior with the implementation of `rsock_connect()`, this change makes `TCPSocket.new` raise `IO::TimeoutError` when a user-specified timeout occurs. Similarly, `Socket.tcp` is updated to raise `IO::TimeoutError` when a timeout occurs within the method. (Note that the existing behavior of `Addrinfo#connect_internal`, which Socket.tcp depends on internally and which raises `Errno::ETIMEDOUT` on timeout, is not changed.) * [ruby/net-http] Raise `Net::OpenTimeout` when `TCPSocket.open` raises `IO::TimeoutError`. With the changes in https://github.com/ruby/ruby/pull/15602, `TCPSocket.open` now raises `IO::TimeoutError` when a user-specified timeout occurs. This change updates #connect to handle this case accordingly. https://github.com/ruby/net-http/commit/f64109e1cf
2025-12-17[Bug #21787] IO::Buffer: Check addition overflowsNobuyoshi Nakada
https://hackerone.com/reports/3437743
2025-12-17IO::Buffer: Fill the test for `IO::Buffer#clear`Nobuyoshi Nakada
2025-12-17Bundle RubyGems 4.0.2 and Bundler 4.0.2Hiroshi SHIBATA
2025-12-16Make tracepoints with set_trace_func or TracePoint.new ractor local (#15468)Luke Gruber
Before this change, GC'ing any Ractor object caused you to lose all enabled tracepoints across all ractors (even main). Now tracepoints are ractor-local and this doesn't happen. Internal events are still global. Fixes [Bug #19112]
2025-12-16Box: fix the class name in testsNobuyoshi Nakada
2025-12-16Box: fix the environment variable nameNobuyoshi Nakada
2025-12-16Box: move extensions from namespace to boxNobuyoshi Nakada
2025-12-16Revert "[Feature #6012] Extend `source_location` for end positionNobuyoshi Nakada
and columns" This reverts commit 073c4e1cc712064e626914fa4a5a8061f903a637. https://bugs.ruby-lang.org/issues/6012#note-31 > we will cancel this feature in 4.0 because of design ambiguities > such as whether to return column positions in bytes or characters as > in [#21783]. [#21783]: https://bugs.ruby-lang.org/issues/21783
2025-12-16[ruby/rubygems] Added assertion for Windows and nmakeHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/be5c4e27d9