summaryrefslogtreecommitdiff
path: root/test/ruby
Commit message (Collapse)AuthorAgeFilesLines
...
* Write keyword arguments directlyNobuyoshi Nakada2023-03-241-2/+2
| | | | | `assert_normal_exit` uses keyword arguments since 2013, commit 05dd6b194cc29961a7cecfd5c3852f06dd56a871.
* YJIT: Save PC on rb_str_concat (#7586)Takashi Kokubun2023-03-231-0/+19
| | | | | [Bug #19483] Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
* Lazily allocate id tables for childrenAaron Patterson2023-03-221-0/+16
| | | | | | | | | | This patch lazily allocates id tables for shape children. If a shape has only one single child, it tags the child with a bit. When we read children, if the id table has the bit set, we know it's a single child. If we need to add more children, then we create a new table and evacuate the child to the new table. Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
* Fixup 43d20596b8fefadc309348448352bf13615129c6Hiroshi SHIBATA2023-03-221-1/+2
|
* Relax timeout limit for FreeBSDHiroshi SHIBATA2023-03-221-1/+1
| | | | | * http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20230322T063002Z.fail.html.gz * http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20230322T063002Z.fail.html.gz
* YJIT: Fix deadlock in tests due to pipe capacityAlan Wu2023-03-211-2/+13
| | | | | | | | | | | | Previously, when there is enough stats that the child process fills up the pipe capacity, the child process would block, with the parent process waiting forever as no one is reading to clear up the pipe. The test timed out in these situations. Use a separate thread in the parent to read from the pipe to unblock the child in these situation. EnvUtil also does this for handling stdout and stderr. I had the test suite deadlock on a Linux VM.
* Use indented heredocNobuyoshi Nakada2023-03-211-2/+2
|
* Use an st table for "too complex" objectsAaron Patterson2023-03-201-0/+21
| | | | | | | | | | st tables will maintain insertion order so we can marshal dump / load objects with instance variables in the same order they were set on that particular instance [ruby-core:112926] [Bug #19535] Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
* Cache `Process.pid`Jean Boussier2023-03-201-0/+20
| | | | | | | | | | | | | | | | | | | | [Feature #19443] It's not uncommon for database client and similar network libraries to protect themselves from Process.fork by regularly checking Process.pid Until recently most libc would cache `getpid()` so this was a cheap check to make. However as of glibc version 2.25 the PID cache is removed and calls to `getpid()` always invoke the actual system call which significantly degrades the performance of existing applications. The reason glibc removed the cache is that some libraries were bypassing `fork(2)` by issuing system calls themselves, causing stale cache issues. That isn't a concern for Ruby as bypassing MRI's primitive for forking would render the VM unusable, so we can safely cache the PID.
* RJIT: Optimize Kernel#block_given?Takashi Kokubun2023-03-191-0/+8
|
* RJIT: Optimize String#<<Takashi Kokubun2023-03-191-0/+8
|
* [Bug #19539] Match heredoc identifier from end of lineNobuyoshi Nakada2023-03-191-0/+10
| | | | Not to ignore leading spaces in indented heredoc identifier.
* Fix frozen status loss when moving objectsPeter Zhu2023-03-181-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Bug #19536] When objects are moved between size pools, their frozen status is lost in the shape. This will cause the frozen check to be bypassed when there is an inline cache. For example, the following script should raise a FrozenError, but doesn't on Ruby 3.2 and master. class A def add_ivars @a = @b = @c = @d = 1 end def set_a @a = 10 end end a = A.new a.add_ivars a.freeze b = A.new b.add_ivars b.set_a # Set the inline cache in set_a GC.verify_compaction_references(expand_heap: true, toward: :empty) a.set_a
* Fix handling of 6-byte codepoints in left_adjust_char_head in CESU-8 encodingJosef Haider2023-03-181-0/+4
|
* ObjectSpace::WeakMap: clean inverse reference when an entry is re-assignedJean Boussier2023-03-171-0/+17
| | | | | | | | | | | | [Bug #19531] ```ruby wmap[1] = "A" wmap[1] = "B" ``` In the example above, we need to remove the `"A" => 1` inverse reference so that when `"A"` is GCed the `1` key isn't deleted.
* core_assertions.rb: Relax `assert_linear_performance`Nobuyoshi Nakada2023-03-181-1/+1
| | | | | | | | * Use an `Enumerable` as factors, instead of three arguments. * Include `assert_operator` time in rehearsal time. * Round up max expected time.
* Fix small issues concerning namespacing in test-all suitelukeg2023-03-174-0/+8
| | | | | * Fix temporary methods on Object leaking across test cases. * Remove temporary classes/modules leaking across test cases.
* Revert "core_assertions.rb: Refine `assert_linear_performance`"Takashi Kokubun2023-03-161-1/+1
| | | | | | | This reverts commit cae4342dd559e34c1ce6219593f77f0ad80286da. This is failing a lot of CIs and nobody is actively looking into fixing it. Let me revert this until we have a solution to it.
* Add thread and ractor counts to bug reportsAlan Wu2023-03-161-0/+3
| | | | | | | | | | | | | | This is useful for crash triaging. It also helps to hint extension developers about the misuse of `rb_thread_call_without_gvl()`. Example: $ ./miniruby -e 'Ractor.new{Ractor.receive}; Thread.new{sleep}; Process.kill:SEGV,Process.pid' <snip> -- Threading information --------------------------------------------------- Total ractor count: 2 Ruby thread count for this ractor: 2
* core_assertions.rb: Refine `assert_linear_performance`Nobuyoshi Nakada2023-03-161-1/+1
| | | | * Use an `Enumerable` as factors, instead of three arguments.
* `Hash#dup` for kwsplat argumentsKoichi Sasada2023-03-151-0/+10
| | | | | | | On `f(*a, **kw)` method calls, a rest keyword parameter is identically same Hash object is passed and it should make `#dup`ed Hahs. fix https://bugs.ruby-lang.org/issues/19526
* Remove SIGCHLD `waidpid`. (#7527)Samuel Williams2023-03-151-43/+0
| | | | | | | * Remove `waitpid_lock` and related code. * Remove un-necessary test. * Remove `rb_thread_sleep_interruptible` dead code.
* Fix crash during compactionPeter Zhu2023-03-141-0/+10
| | | | | | | | | | | | | | | | | [Bug #19529] The fix for [Bug #19529] in commit 548086b contained a bug that crashes on the following script: ``` wm = ObjectSpace::WeakMap.new obj = Object.new 100.times do wm[Object.new] = obj GC.start end GC.compact ```
* ObjectSpace::WeakMap: fix compaction supportJean Boussier2023-03-141-0/+8
| | | | | | | | [Bug #19529] `rb_gc_update_tbl_refs` can't be used on `w->obj2wmap` because it's not a `VALUE -> VALUE` table, but a `VALUE -> VALUE *` table, so we need some dedicated iterator.
* Revert SIGCHLD changes to diagnose CI failures. (#7517)Samuel Williams2023-03-141-0/+43
| | | | | | | | | | | | | | | * Revert "Remove special handling of `SIGCHLD`. (#7482)" This reverts commit 44a0711eab7fbc71ac2c8ff489d8c53e97a8fe75. * Revert "Remove prototypes for functions that are no longer used. (#7497)" This reverts commit 4dce12bead3bfd91fd80b5e7195f7f540ffffacb. * Revert "Remove SIGCHLD `waidpid`. (#7476)" This reverts commit 1658e7d96696a656d9bd0a0c84c82cde86914ba2. * Fix change to rjit variable name.
* RJIT: Simplify how Capstone is used in testsTakashi Kokubun2023-03-131-13/+2
|
* [Bug #19476]: correct cache index computation for repetition (#7457)TSUYUSATO Kitsune2023-03-131-0/+5
|
* * remove trailing spaces. [ci skip]git2023-03-131-1/+1
|
* [Bug #19467] correct cache points and counting failure on ↵TSUYUSATO Kitsune2023-03-131-0/+10
| | | | `OP_ANYCHAR_STAR_PEEK_NEXT` (#7454)
* Add test for linear performanceNobuyoshi Nakada2023-03-121-0/+7
|
* RJIT: Handle Mod 10 for CMP r/m64, r64Takashi Kokubun2023-03-111-1/+3
|
* RJIT: Use lambda constants to match operandsTakashi Kokubun2023-03-111-12/+54
|
* Move yjit_force_enabled? to JITSupportTakashi Kokubun2023-03-111-9/+3
| | | | for consistency
* Remove unused methods from JITSupportTakashi Kokubun2023-03-111-1/+1
|
* RJIT: Write initial tests for AssemblerTakashi Kokubun2023-03-101-7/+258
|
* RJIT: Start testing AssemblerTakashi Kokubun2023-03-101-0/+66
|
* RJIT: Break up and enable test_version (#7495)Takashi Kokubun2023-03-101-29/+25
|
* Revert "Allow classes and modules to become too complex"Aaron Patterson2023-03-101-21/+1
| | | | This reverts commit 69465df4242f3b2d8e55fbe18d7c45b47b40a626.
* Revert and refine tests for uninitialized queueNobuyoshi Nakada2023-03-101-0/+12
| | | | | `Queue` and `SizedQueue` still check array members. Only the test of `ConditionVariable` is useless.
* Remove stale testsNobuyoshi Nakada2023-03-102-18/+0
| | | | | | These tests were added at a198bb3929a4562a12b4aa245a297c7d3695149f, when these classes were `Struct`s. Since these classes have been rewritten, these tests no longer make sense.
* Allow classes and modules to become too complexHParker2023-03-091-1/+21
| | | | This makes the behavior of classes and modules when there are too many instance variables match the behavior of objects with too many instance variables.
* Make sure TestDefaultGems#test_validate_gemspec runs even when Dir.pwd != srcdirlukeg2023-03-091-4/+11
| | | | | | For instance, when running tests in build directory like: $ make test-all TESTOPTS="../ruby/test"
* Remove SIGCHLD `waidpid`. (#7476)Samuel Williams2023-03-091-43/+0
| | | | | | | * Remove `waitpid_lock` and related code. * Remove un-necessary test. * Remove `rb_thread_sleep_interruptible` dead code.
* s/mjit/rjit/Takashi Kokubun2023-03-064-17/+17
|
* s/MJIT/RJIT/Takashi Kokubun2023-03-0611-21/+21
|
* Omit test_version for Cirrus for nowTakashi Kokubun2023-03-051-0/+1
|
* Remove an obsoleted testTakashi Kokubun2023-03-051-7/+0
|
* Skip a failing shape testTakashi Kokubun2023-03-051-0/+1
|
* Drop existing MJIT testsTakashi Kokubun2023-03-053-1450/+0
|
* [Bug #19471] `Regexp.compile` should handle keyword argumentsNobuyoshi Nakada2023-03-031-0/+5
| | | | | As well as `Regexp.new`, it should pass keyword arguments to the `Regexp#initialize` method.