summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
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
2025-12-16[ruby/rubygems] Reset MAKEFLAGS option for build jobs testsHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/09e6031a11
2025-12-16[ruby/rubygems] Allow to specify the number of `make` jobs when installing gems:Edouard CHIN
- Added a new `-j` option to `gem install` and `gem update`. This option allows to specify the number of jobs we pass to `make` when compiling gem with native extensions. By default its the number of processors, but users may want a way to control this. You can use it like so: `gem install json -j8` https://github.com/ruby/rubygems/commit/67aad88ca6
2025-12-15YJIT: Bail out if proc would be stored above stack topRandy Stauner
Fixes [Bug #21266].
2025-12-15[ruby/psych] Check that Data members match exactlyBenoit Daloze
* Fixes https://github.com/ruby/psych/issues/760 https://github.com/ruby/psych/commit/952008c898
2025-12-15[ruby/net-http] Refactor HTTPS testsKazuki Yamaguchi
This contains various improvements in tests for openssl integration: - Remove DHE parameters from test servers. OpenSSL is almost always compiled with ECC support nowadays and will prefer ECDHE over DHE. - Remove an outdated omission for a bug in OpenSSL 1.1.0h released in 2018. None of our CI systems use this specific OpenSSL version. - Use top-level return to skip tests if openssl is unavailable. - Refactor tests for Net::HTTP#verify_callback. https://github.com/ruby/net-http/commit/35c1745a26
2025-12-15[ruby/rubygems] Write gem files atomicallyeileencodes
This change updates `write_binary` to use a new class, `AtomicFileWriter.open` to write the gem's files. This implementation is borrowed from Active Support's [`atomic_write`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/file/atomic.rb). Atomic write will write the files to a temporary file and then once created, sets permissions and renames the file. If the file is corrupted - ie on failed download, an error occurs, or for some other reason, the real file will not be created. The changes made here make `verify_gz` obsolete, we don't need to verify it if we have successfully created the file atomically. If it exists, it is not corrupt. If it is corrupt, the file won't exist on disk. While writing tests for this functionality I replaced the `RemoteFetcher` stub with `FakeFetcher` except for where we really do need to overwrite the `RemoteFetcher`. The new test implementation is much clearer on what it's trying to accomplish versus the prior test implementation. https://github.com/ruby/rubygems/commit/0cd4b54291
2025-12-14[ruby/openssl] pkcs7: raise OpenSSL::PKCS7::PKCS7Error in #initializeKazuki Yamaguchi
When d2i_PKCS7_bio() and PEM_read_bio_PKCS7() fail to decode the input, OpenSSL::PKCS7.new currently raises ArgumentError. The usual practice in ruby/openssl where an error originates from the underlying OpenSSL library is to raise OpenSSL::OpenSSLError. Raise OpenSSL::PKCS7::PKCS7Error instead for consistency with OpenSSL::PKCS7.read_smime and all other existing #initialize methods that handle DER/PEM-encoded inputs. https://github.com/ruby/openssl/commit/67a608ce53
2025-12-14ZJIT: Add a test for `--zjit-stats=<path>` optionNobuyoshi Nakada
Fix up ruby/ruby#15414, 29c29c2b7e972359ab83038c5dc27a7e53ae65c7
2025-12-14ZJIT: Fix tests about `--zjit-stats-quiet` optionNobuyoshi Nakada
The `--zjit-stats-quiet` and `--zjit-stats=quiet` options differ. The latter option, `=quiet`, does print stats to the file "quiet", but does not suppress output like yjit option `--yjit-stats=quiet`. Fix up ruby/ruby#15414, 29c29c2b7e972359ab83038c5dc27a7e53ae65c7
2025-12-13[ruby/openssl] ossl.c: implement OpenSSL::OpenSSLError#detailed_messageKazuki Yamaguchi
An OpenSSL function sometimes puts more than one error entry into the thread-local OpenSSL error queue. Currently, we use the highest-level entry for generating the exception message and discard the rest. Let ossl_make_error() capture all current OpenSSL error queue contents into OpenSSL::OpenSSLError#errors and extend OpenSSL::OpenSSLError#detailed_message to include the information. An example: $ ruby -Ilib -ropenssl -e'OpenSSL::X509::ExtensionFactory.new.create_ext("a", "b")' -e:1:in 'OpenSSL::X509::ExtensionFactory#create_ext': a = b: error in extension (name=a, value=b) (OpenSSL::X509::ExtensionError) OpenSSL error queue reported 2 errors: error:11000082:X509 V3 routines:do_ext_nconf:unknown extension name error:11000080:X509 V3 routines:X509V3_EXT_nconf_int:error in extension (name=a, value=b) from -e:1:in '<main>' https://github.com/ruby/openssl/commit/d28f7a9a13
2025-12-13Enumerator.produce accepts an optional `size` keyword argumentAkinori Musha
When not specified, the size is unknown (`nil`). Previously, the size was always `Float::INFINITY` and not specifiable. [Feature #21701]
2025-12-13ZJIT: Nil-fill locals in direct send (#15536)Randy Stauner
Avoid garbage reads from locals in eval. Before the fix the test fails with <"[\"x\", \"x\", \"x\", \"x\"]"> expected but was <"[\"x\", \"x\", \"x\", \"x286326928\"]">.
2025-12-12ZJIT: Don't inline non-parameter localsRandy Stauner