summaryrefslogtreecommitdiff
path: root/test/-ext-
AgeCommit message (Collapse)Author
6 daysRename `alloca_overflow` to `stack_overflow`Nobuyoshi Nakada
`alloca` is an implementation detail to raise a stack overflow.
6 daysUse `assert_ruby_status` if no assertionNobuyoshi Nakada
2025-12-16Box: fix the environment variable nameNobuyoshi Nakada
2025-12-16Box: move extensions from namespace to boxNobuyoshi Nakada
2025-12-12Avoid race condition in `test_without_handle_interrupt_signal_works`. (#15504)Samuel Williams
2025-12-10Remove object_id in NEWOBJ tracepoint testJean Boussier
Generating an object_id for any type other than T_OBJECT (and T_CLASS) will inevitably allocate an IMEMO/fields objects, which isn't supported in a NEWOBJ tracepoint. See: https://bugs.ruby-lang.org/issues/21710#note-23
2025-12-07Suppress noisy outputsNobuyoshi Nakada
Fix up ruby/ruby#14700.
2025-12-06Yield to scheduler if interrupts are pending. (#14700)Samuel Williams
2025-12-03Handle NEWOBJ tracepoints settings fieldsJean Boussier
[Bug #21710] - struct.c: `struct_alloc` It is possible for a `NEWOBJ` tracepoint call back to write fields into a newly allocated object before `struct_alloc` had the time to set the `RSTRUCT_GEN_FIELDS` flags and such. Hence we can't blindly initialize the `fields_obj` reference to `0` we first need to check no fields were added yet. - object.c: `rb_class_allocate_instance` Similarly, if a `NEWOBJ` tracepoint tries to set fields on the object, the `shape_id` must already be set, as it's required on T_OBJECT to know where to write fields. `NEWOBJ_OF` had to be refactored to accept a `shape_id`.
2025-11-14Skip tests in TestThreadLockNativeThread when using LSANPeter Zhu
These tests use NM threads but NT is not freed for MN thread, causing it to be reported as memory leaks in LSAN. For example: #1 0x62ee7bc67e99 in calloc1 gc/default/default.c:1495:12 #2 0x62ee7bc7ba00 in rb_gc_impl_calloc gc/default/default.c:8216:5 #3 0x62ee7bc631d1 in ruby_xcalloc_body gc.c:5221:12 #4 0x62ee7bc5cdbc in ruby_xcalloc gc.c:5215:34 #5 0x62ee7bdea4c6 in native_thread_alloc thread_pthread.c:2187:35 #6 0x62ee7bdec31b in native_thread_check_and_create_shared thread_pthread_mn.c:429:39 #7 0x62ee7bdea484 in native_thread_create_shared thread_pthread_mn.c:531:12 #8 0x62ee7bdea1da in native_thread_create thread_pthread.c:2403:16 #9 0x62ee7bdde2eb in thread_create_core thread.c:884:11 #10 0x62ee7bde4466 in thread_initialize thread.c:992:16
2025-11-07Follow renaming from Namespace to Ruby::BoxSatoshi Tagomori
2025-11-07rename namespace.c (and others) to box.cSatoshi Tagomori
2025-09-17Unset RUBY_CRASH_REPORT in tests that crash on purposeAlan Wu
2025-09-05ZJIT: Fix tests for ZJIT (#14460)Takashi Kokubun
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-08-15Fix tests using assert_raise_with_message on US-ASCII systemsPeter Zhu
On systems where the Encoding.default_internal defaults to US-ASCII instead of UTF-8, some tests using assert_raise_with_message can fail since it no longer changes Encoding.default_internal in 79f5202. This tests explicitly uses EnvUtil.with_default_internal on systems where these tests fail.
2025-08-15Relax a delta for an unstable test (#14246)Takashi Kokubun
https://github.com/ruby/ruby/actions/runs/16995978143/job/48186652826?pr=14244
2025-06-19Relax delta valueHiroshi SHIBATA
https://github.com/ruby/ruby/actions/runs/15751511003/job/44397451542?pr=13649 ``` 1) Failure: TestLastThread#test_last_thread [/Users/runner/work/ruby/ruby/src/test/-ext-/gvl/test_last_thread.rb:18]: Expected |1.0 - 1.167141| (0.16714099999999998) to be <= 0.16. ```
2025-06-11Try to run ignored tests with macOS 15Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13581
2025-05-31`Ractor::Port`Koichi Sasada
* Added `Ractor::Port` * `Ractor::Port#receive` (support multi-threads) * `Rcator::Port#close` * `Ractor::Port#closed?` * Added some methods * `Ractor#join` * `Ractor#value` * `Ractor#monitor` * `Ractor#unmonitor` * Removed some methods * `Ractor#take` * `Ractor.yield` * Change the spec * `Racotr.select` You can wait for multiple sequences of messages with `Ractor::Port`. ```ruby ports = 3.times.map{ Ractor::Port.new } ports.map.with_index do |port, ri| Ractor.new port,ri do |port, ri| 3.times{|i| port << "r#{ri}-#{i}"} end end p ports.each{|port| pp 3.times.map{port.receive}} ``` In this example, we use 3 ports, and 3 Ractors send messages to them respectively. We can receive a series of messages from each port. You can use `Ractor#value` to get the last value of a Ractor's block: ```ruby result = Ractor.new do heavy_task() end.value ``` You can wait for the termination of a Ractor with `Ractor#join` like this: ```ruby Ractor.new do some_task() end.join ``` `#value` and `#join` are similar to `Thread#value` and `Thread#join`. To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced. This commit changes `Ractor.select()` method. It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates. We removes `Ractor.yield` and `Ractor#take` because: * `Ractor::Port` supports most of similar use cases in a simpler manner. * Removing them significantly simplifies the code. We also change the internal thread scheduler code (thread_pthread.c): * During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks. This lock is released by `rb_ractor_sched_barrier_end()` which is called at the end of operations that require the barrier. * fix potential deadlock issues by checking interrupts just before setting UBF. https://bugs.ruby-lang.org/issues/21262 Notes: Merged: https://github.com/ruby/ruby/pull/13445
2025-05-26Add shape_id to RBasic under 32 bitJohn Hawthorn
This makes `RBobject` `4B` larger on 32 bit systems but simplifies the implementation a lot. [Feature #21353] Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/13341
2025-05-13Make `waiting_fd` behaviour per-IO. (#13127)Samuel Williams
- `rb_thread_fd_close` is deprecated and now a no-op. - IO operations (including close) no longer take a vm-wide lock. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-05-12YJIT: Split the block on optimized getlocal/setlocal (#13282)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2025-05-11namespace on readSatoshi Tagomori
2025-05-05YJIT: End the block after OPTIMIZE_METHOD_TYPE_CALL (#13245)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2025-04-17Only test on known good platforms. (#13123)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-04-17Prefer `th->ec` for stack base/size. (#13101)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-03-27Skip TestThreadInstrumentation#test_sleeping_inside_ractor on ModGC workflow ↵Naoto Ono
(#12996) TestThreadInstrumentation#test_sleeping_inside_ractor is a flaky and failing intermittently. Additionally, Launchable reported this test as a top flaky test. (Link: https://app.launchableinc.com/organizations/ruby/workspaces/ruby/insights/unhealthy-tests) It failed only failed intermittently on ModGC workflow, so I'm gonna skip this test on ModGC workflow. Notes: Merged-By: ono-max <onoto1998@gmail.com>
2025-03-17Manage skipping instance variable IDs in one placeNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12923
2025-02-13[Feature #21116] Extract RJIT as a third-party gemNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12740
2024-11-13Move Array#map to RubyTakashi Kokubun
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/12074
2024-11-06macOS 15 is the stable version todayHiroshi SHIBATA
2024-10-03Fix indentation in test_after_gc_start_hook_with_GC_stressPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/11765
2024-09-11Use macos? helperHiroshi SHIBATA
2024-07-31Reset the counter for two consecutive runsSatoshi Tagomori
Notes: Merged: https://github.com/ruby/ruby/pull/11284
2024-07-30Use tmpdir for various environments (including Windows)Satoshi Tagomori
Notes: Merged: https://github.com/ruby/ruby/pull/11254
2024-07-30Fix test code and extension to avoid using gvars and Kernel methodsSatoshi Tagomori
Notes: Merged: https://github.com/ruby/ruby/pull/11254
2024-07-30[BUG #20655] Add tests to use rb_ensure and call cont.callSatoshi Tagomori
Notes: Merged: https://github.com/ruby/ruby/pull/11254
2024-07-18[PRISM] Refactor parser support into its own moduleKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11201
2024-07-18Refactor RUBY_DESCRIPTION assertions in test_rubyoptionsKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11192
2024-07-12Pend some tests because these are not working with macOS 15 beta and Xcode ↵Hiroshi SHIBATA
16 beta
2024-06-19String.new(capacity:) don't substract termlenJean Boussier
[Bug #20585] This was changed in 36a06efdd9f0604093dccbaf96d4e2cb17874dc8 because `String.new(1024)` would end up allocating `1025` bytes, but the problem with this change is that the caller may be trying to right size a String. So instead, we should just better document the behavior of `capacity:`.
2024-06-13Add rb_str_resize coderange testtompng
2024-06-07Make subclasses to define methodsNobuyoshi Nakada
2024-06-02Stop exposing `rb_str_chilled_p`Jean Boussier
[Feature #20205] Now that chilled strings no longer appear as frozen, there is no need to offer an API to check for chilled strings. We however need to change `rb_check_frozen_internal` to no longer be a macro, as it needs to check for chilled strings.
2024-05-20Fix incorrect assertion in TestThreadInstrumentationJean Boussier
The test meant to assert the thread is suspended at least once, but was actually asserting to it to be suspected at least twice.
2024-03-26Expose rb_str_chilled_pÉtienne Barrié
Some extensions (like stringio) may need to differentiate between chilled strings and frozen strings. They can now use rb_str_chilled_p but must check for its presence since the function will be removed when chilled strings are removed. [Bug #20389] [Feature #20205] Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-14Ensure test suite is compatible with --frozen-string-literalJean Boussier
As preparation for https://bugs.ruby-lang.org/issues/20205 making sure the test suite is compatible with frozen string literals is making things easier.
2024-03-03[Bug #20322] Fix rb_enc_interned_str_cstr null encodingThomas Marshall
The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be a null pointer, but this currently causes a segmentation fault when trying to autoload the encoding. This commit fixes the issue by checking for NULL before calling `rb_enc_autoload`.
2024-02-21`rb_thread_lock_native_thread()`Koichi Sasada
Introduce `rb_thread_lock_native_thread()` to allocate dedicated native thread to the current Ruby thread for M:N threads. This C API is similar to Go's `runtime.LockOSThread()`. Accepted at https://github.com/ruby/dev-meeting-log/blob/master/2023/DevMeeting-2023-08-24.md (and missed to implement on Ruby 3.3.0)