summaryrefslogtreecommitdiff
path: root/test/-ext-
AgeCommit message (Collapse)Author
2025-04-17Only test on known good platforms. (#13123)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2025-04-17Prefer `th->ec` for stack base/size. (#13101)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
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 <[email protected]>
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 <[email protected]> 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 <[email protected]>
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)
2024-02-15Show the method owner in backtracesYusuke Endoh
``` test.rb:1:in 'Object#toplevel_meth': unhandled exception from test.rb:4:in 'Foo.class_meth' from test.rb:6:in 'Foo#instance_meth' from test.rb:11:in 'singleton_meth' from test.rb:13:in '<main>' ``` [Feature #19117]
2024-02-15Do not include a backtick in error messages and backtracesYusuke Endoh
[Feature #16495]
2024-01-31[PRISM] Fix test_bug_reporter with prismKevin Newton
2024-01-25Use Encoding::CESU_8 for test caseHiroshi SHIBATA
Encoding::Windows_31J is already loaded in mswin platform
2023-12-28Fix use of the rb_profile_frames start parameterDylan Thacker-Smith
Previously, it was decrementing the start argument until it reached zero without actually changing the control frame pointer. [Bug #14607]
2023-12-15loading/testing in different processes for multiple runsSatoshi Tagomori
2023-12-14rb_ext_resolve_symbol: C API to resolve and return externed symbols [Feature ↵Satoshi Tagomori
#20005] This is a C API for extensions to resolve and get function symbols of other extensions. Extensions can check the expected symbol is correctly loaded and accessible, and use it if it is available. Otherwise, extensions can raise their own error to guide users to setup their environments correctly and what's missing.
2023-12-13Add a test case for preregistering with different dataKJ Tsanaktsidis
We want to make sure that if preregister is called with different data, that the postponed job table is updated.
2023-12-12Remove unused statementYusuke Endoh
... to disable a warning: assigned but unused variable - expected
2023-12-10Change the semantics of rb_postponed_job_registerKJ Tsanaktsidis
Our current implementation of rb_postponed_job_register suffers from some safety issues that can lead to interpreter crashes (see bug #1991). Essentially, the issue is that jobs can be called with the wrong arguments. We made two attempts to fix this whilst keeping the promised semantics, but: * The first one involved masking/unmasking when flushing jobs, which was believed to be too expensive * The second one involved a lock-free, multi-producer, single-consumer ringbuffer, which was too complex The critical insight behind this third solution is that essentially the only user of these APIs are a) internal, or b) profiling gems. For a), none of the usages actually require variable data; they will work just fine with the preregistration interface. For b), generally profiling gems only call a single callback with a single piece of data (which is actually usually just zero) for the life of the program. The ringbuffer is complex because it needs to support multi-word inserts of job & data (which can't be atomic); but nobody actually even needs that functionality, really. So, this comit: * Introduces a pre-registration API for jobs, with a GVL-requiring rb_postponed_job_prereigster, which returns a handle which can be used with an async-signal-safe rb_postponed_job_trigger. * Deprecates rb_postponed_job_register (and re-implements it on top of the preregister function for compatability) * Moves all the internal usages of postponed job register pre-registration
2023-12-09Fix test of GVL instrumentation on Ractor sleepingJohn Hawthorn
It seems that the Ractor sleep GVL event arrives very slightly after the value becomes available and other threads wake (which makes sense) so we need a little additional time to ensure we end up in a consisteny state.
2023-12-09Add missing GVL hooks for M:N threads and ractorsJohn Hawthorn
2023-12-03Revert "Add missing GVL hooks for M:N threads and ractors"John Hawthorn
This reverts commit ad54fbf281ca1935e79f4df1460b0106ba76761e.
2023-12-02Add missing GVL hooks for M:N threads and ractorsJohn Hawthorn
[Bug #20019] This fixes GVL instrumentation in three locations it was missing: - Suspending when blocking on a Ractor - Suspending when doing a coroutine transfer from an M:N thread - Resuming after an M:N thread starts Co-authored-by: Matthew Draper <[email protected]>
2023-11-29[Bug #20025] Check if upper/lower before fallback to case-foldingNobuyoshi Nakada
2023-11-28Further fix the GVL instrumentation APIJean Boussier
Followup: https://github.com/ruby/ruby/pull/9029 [Bug #20019] Some events still weren't triggered from the right place. The test suite was also improved a bit more.
2023-11-27Refactor and fix the GVL instrumentation APIJean Boussier
This entirely changes how it is tested. Rather than to use counters we now record the timeline of events with associated threads which makes it much easier to assert that certains events are only preceded by a specific event, and makes it much easier to debug unexpected timelines. Co-Authored-By: Étienne Barrié <[email protected]> Co-Authored-By: JP Camara <[email protected]> Co-Authored-By: John Hawthorn <[email protected]>
2023-11-13GVL Instrumentation: pass thread->self as part of event dataJean Boussier
Context: https://github.com/ivoanjo/gvl-tracing/pull/4 Some hooks may want to collect data on a per thread basis. Right now the only way to identify the concerned thread is to use `rb_nativethread_self()` or similar, but even then because of the thread cache or MaNy, two distinct Ruby threads may report the same native thread id. By passing `thread->self`, hooks can use it as a key to store the metadata. NB: Most hooks are executed outside the GVL, so such data collection need to use a thread-safe data-structure, and shouldn't use the reference in other ways from inside the hook. They must also either pin that value or handle compaction.
2023-11-08String for string literal is not resizableNobuyoshi Nakada
2023-11-03Skip a test that is flaky with RJITTakashi Kokubun
It's crashing inside the bug reporter after a crash, so not sure why it's crashing. It's not really useful for maintaining RJIT to flag this test failure, so let's just ignore it until we figure out why it fails. https://github.com/ruby/ruby/actions/runs/6752729246/job/18358439166
2023-11-03Fix thread leakageNobuyoshi Nakada
Wait for the worker thread to finish.
2023-11-02Make String.new size pools aware.Jean Boussier
If the required capacity would fit in an embded string, returns one. This can reduce malloc churn for code that use string buffers.
2023-10-31[Feature #10602] Add new API rb_profile_thread_frames()Daisuke Aritomo
Add a new API rb_profile_thread_frames(), which is essentialy a per-thread version of rb_profile_frames(). While the original rb_profile_frames() always returns results about the current active thread obtained by GET_EC(), this new API takes a Thread to be profiled as an argument. This should come in handy when profiling I/O-bound programs such as webapps, since this new API allows us to learn about Threads performing I/O (which do not have the GVL). Profiling worker threads (such as Sidekiq workers) may be another application. Implements [Feature #10602] Co-authored-by: Mike Perham <[email protected]>
2023-10-18Show backtraces when failedKoichi Sasada
If `assert_equal(backtrace_locations.size, profile_frames.size)` in `TestProfileFrames#test_matches_backtrace_locations_main_thread` failed, we do not have enough information about it like that: ``` 1) Failure: TestProfileFrames#test_matches_backtrace_locations_main_thread [/home/runner/work/ruby/ruby/src/test/-ext-/debug/test_profile_frames.rb:148]: <31> expected but was <30>. ``` This patch shows both `backtrace_locations` and `profile_frames` if failed.
2023-09-26[Bug #19902] Update the coderange regarding the changed regionNobuyoshi Nakada