77 Commits
Author SHA1 Message Date
Hiroshi SHIBATAandClaude Opus 5.5 1086cad18c Keep tests that crash on purpose from running RUBY_ON_BUG
EnvUtil passes RUBY_ON_BUG down to child processes, so one set for the whole test run acts on these two tests, which crash a child on purpose. The foreign store test runs only with RUBY_DEBUG. The other such tests already clear it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 12:21:26 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 baac8f3002 Keep tests that crash on purpose from dumping core
Like the other tests that crash a child on purpose, these leave a core on every run wherever the core size limit allows it, which buries real crashes among the collected dumps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 09:57:38 +09:00
Nobuyoshi Nakada ec9d3e21b5 Remove the stale test 2026-09-24 21:58:56 +09:00
Nobuyoshi Nakada 28ae8099dc Preserve jobserver limits across repeated test runs
Keep the jobserver connection until all repetitions finish so that
later runs do not launch up to 256 workers without token limits.
2026-09-24 21:51:13 +09:00
Hiroshi SHIBATA f7462782e3 Split -I option with File::PATH_SEPARATOR in test runner
The test runner split -Idirectory on a hardcoded ":", so on Windows an
absolute path such as -IV:/foo/lib was broken into "V" and "/foo/lib".
The tail only resolved by accident when the current drive matched.
File::PATH_SEPARATOR is the right delimiter, matching ruby -I itself.
This is the same class of bug as the test-syntax-suggest -I fix in
commit 3c7a4c174f, which replaced ":" with $(PATH_SEPARATOR) in
common.mk. Makefiles only pass relative paths, so this stayed latent.
2026-07-13 14:19:42 +09:00
Koichi Sasada 2ba2950d20 show loadavg if the test fails
to survey the following failure:

```
  1) Failure:
TestFile#test_stat [/tmp/ruby/src/trunk-repeat20/test/ruby/test_file.rb:412]:
Expected |1770056232.744032 - 1770056230.6465776| (2.097454309463501) to be <= 1.
```

BTW I found that `test/ruby/test_file.rb:412` `assert_in_delta atime, stat.atime.to_f, delta`
only fails (mtime, ctime doesn't fail on 100 days).
2026-02-04 12:40:59 +09:00
Nobuyoshi Nakada 886202bac8 Count assertions in child processes
Fix up GH-15785.
2026-01-15 12:30:29 +09:00
Nobuyoshi Nakada d40e056cc8 Skip the hang-up test on Windows 2025-12-31 02:24:21 +09:00
Alan Wu 7ed1b24bf3 Unset RUBY_CRASH_REPORT in tests that crash on purpose 2025-09-17 13:35:35 -04:00
Nobuyoshi Nakada b066260296 Follow up testunit
* Update method names.
* Sort shuffled tests by names.
2025-06-18 01:46:58 +09:00
Nobuyoshi Nakada 1a527929a5 Revert "Temporary pend unknown behavior of parallel tests"
This reverts commit 980f61935f, which
seems no longer needed.
2025-06-18 01:46:58 +09:00
Yusuke Endoh fc26004660 Remove test_retry_workers
The test fails randomly for unknown reason.

https://github.com/ruby/ruby/actions/runs/14121674932/job/39562945096?pr=12993
```
    1) Error:
  TestParallel::TestParallel#test_retry_workers:
  Test::Unit::ProxyError: execution expired (start: 2025-03-28 04:04:10 +0000, end: 2025-03-28 04:05:50 +0000)
      /home/runner/work/ruby/ruby/src/tool/test/testunit/test_parallel.rb:16:in 'TestParallel.timeout'
      /home/runner/work/ruby/ruby/src/tool/test/testunit/test_parallel.rb:225:in 'TestParallel::TestParallel#test_retry_workers'
```

Maybe the workers do not respond "quit" request.

We no longer use the retry mechanism, so just remove the test.
2025-03-28 14:19:33 +09:00
Yusuke Endoh 28c7ae6626 Try avoiding "invalid byte sequence in UTF-8" 2025-03-28 14:19:33 +09:00
Yusuke Endoh 12f8dda9e0 Report the actual time wated for timeout errors in TestParallel 2025-03-28 14:19:33 +09:00
Naoto Ono 2dff416ff2 Increase timeout in TestParallel testing to reduce flaky failures (#12822)
Currently, the following tests are flaky and failing intermittently, so I'm going to increase the timeout to improve stability.

```  
    1) Failure:
  TestParallel::TestParallel#test_hungup [/Users/runner/work/ruby/ruby/src/tool/lib/zombie_hunter.rb:6]:
  Expected [[42009, #<Process::Status: pid 42009 SIGKILL (signal 9)>]] to be empty.
  
    2) Error:
  TestParallel::TestParallel#test_hungup:
  Test::Unit::ProxyError: execution expired
      /Users/runner/work/ruby/ruby/src/lib/timeout.rb:40:in 'Timeout::Error.handle_timeout'
      /Users/runner/work/ruby/ruby/src/lib/timeout.rb:194:in 'Timeout.timeout'
      /Users/runner/work/ruby/ruby/src/tool/test/testunit/test_parallel.rb:210:in 'TestParallel::TestParallel#test_hungup'

```
https://github.com/ruby/ruby/actions/runs/13560087551/job/37901506230#step:14:105

```
    1) Error:
  TestParallel::TestParallel#test_retry_workers:
  Test::Unit::ProxyError: execution expired
      /Users/runner/work/ruby/ruby/src/lib/timeout.rb:40:in 'Timeout::Error.handle_timeout'
      /Users/runner/work/ruby/ruby/src/lib/timeout.rb:194:in 'Timeout.timeout'
      /Users/runner/work/ruby/ruby/src/tool/test/testunit/test_parallel.rb:217:in 'TestParallel::TestParallel#test_retry_workers'
```
https://github.com/ruby/ruby/actions/runs/13559151505/job/37899041580#step:14:106
2025-02-27 07:55:54 +00:00
Naoto Ono 48b6c60969 [Misc #20661] Stop retrying tests in make test-all command by default (#11271)
[Misc #20661] Stop retrying tests in make test-all command by default
2025-02-27 06:12:02 +00:00
Nobuyoshi Nakada 4a67ef09cc [Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
Nobuyoshi Nakada c51668d249 Add Test::Unit::CoreAssertions#assert_raise_kind_of
Similar to `Test::Unit::assert_raise`, but allows sub classes too.
2025-01-24 15:51:28 +09:00
Nobuyoshi Nakada ae94fca788 Add test for Test::Unit::CoreAssertions#assert_raise_with_message 2025-01-24 15:53:08 +09:00
Peter Zhu 7eeabccf4c Fix TestParallel#test_hungup when RUBY_TEST_TIMEOUT_SCALE is set
When RUBY_TEST_TIMEOUT_SCALE is set, the timeout increases by the multiple
specified. However, the test in test4test_hungup.rb does not scale, so
if RUBY_TEST_TIMEOUT_SCALE is a large number like 10, then the test will
not time out causing the tests test to fail.
2024-10-29 15:34:58 +09:00
Nobuyoshi Nakada fcb058309b Accept version range
Single `Integer` argument means an exact match to the major version.
2024-09-12 23:47:34 +09:00
Yusuke Endoh 062f85e141 Dump all-thread backtraces when test parallel worker exceeds time limit 2024-08-06 21:11:41 +09:00
Naoto Ono 8ede84aa95 Move the file location of launchable.rb 2024-07-08 10:15:04 +09:00
Naoto Ono 5b78925455 Integrate Launchable into make btest 2024-07-08 10:15:04 +09:00
Nobuyoshi Nakada aabe718e64 Show the caller location of assertion methods
Not only defined in `Test::Unit` or `CoreAssertions`, also show the
caller location of assertion methods defined in the current class or
ancestors.
2024-05-08 17:24:36 +09:00
Koichi Sasada 9180e33ca3 show warning for unused block
With verbopse mode (-w), the interpreter shows a warning if
a block is passed to a method which does not use the given block.

Warning on:

* the invoked method is written in C
* the invoked method is not `initialize`
* not invoked with `super`
* the first time on the call-site with the invoked method
  (`obj.foo{}` will be warned once if `foo` is same method)

[Feature #15554]

`Primitive.attr! :use_block` is introduced to declare that primitive
functions (written in C) will use passed block.

For minitest, test needs some tweak, so use
https://github.com/minitest/minitest/commit/ea9caafc0754b1d6236a490d59e624b53209734a
for `test-bundled-gems`.
2024-04-15 12:08:07 +09:00
Naoto Ono 56ecd8038a Launchable: Add lineNumber field 2024-04-03 16:17:30 +09:00
Naoto Ono 3d1d1435c1 Launchable: Refactor the logic of JsonStreamWriter 2024-04-02 21:55:32 +09:00
KJ Tsanaktsidis 75234beb24 Make TestParallel#test_retry_workers consider RUBY_TEST_TIMEOUT_SCALE
This test currently fails if RUBY_TEST_TIMEOUT_SCALE is set, because the
worker timeout is scaled out but the duration of the sleep does not;
thus, the test-test-case does not timeout when it should.
2024-03-28 09:48:53 +11:00
Hiroshi SHIBATA 634e0ac140 Fix test failure with __runner_options__ renaming 2023-10-26 12:39:13 +09:00
lukeg 7717684d16 tool test/unit/testcase: rename vars @passed, @@current
to @__passed__, @@__current__.
@passed is redefined in a few test suites, and this could lead to bugs.

Also rename @options (Runner#options) to @__runner_options__, which is
only used in make test-tool anyway.
2023-10-26 12:39:13 +09:00
Nobuyoshi Nakada 4f4016497e Handle Timeout::Error reported from workers 2023-10-18 23:41:23 +09:00
Nobuyoshi Nakada 776d4dec69 Manage parallel test workers after timeout 2023-10-18 02:55:42 +09:00
Nobuyoshi Nakada 8b520bd3fb Add jobs optional keyword argument 2023-10-18 02:55:42 +09:00
Nobuyoshi Nakada 4589056384 Exit with a failure if any test files failed to load 2023-06-03 20:22:10 +09:00
Takashi Kokubun 2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Nobuyoshi Nakada d903e76726 Allow strings in assert_pattern_list 2022-08-19 01:28:31 +09:00
Nobuyoshi Nakada 7c1ed47097 Add tests for assert_pattern_list 2022-08-18 23:38:56 +09:00
Nobuyoshi Nakada 56b45e8c8e Let testunit use omit or pend instead of skip 2022-01-16 21:35:09 +09:00
Takashi Kokubun 1a63468831 Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Nobuyoshi Nakada c7eac1be51 Retry hung up tests verbosely 2021-10-17 22:40:31 +09:00
Nobuyoshi Nakada 13716898df Retry hung tests after parallel runs 2021-10-17 16:33:58 +09:00
Nobuyoshi Nakada 5de6e25144 Replace unpack with unpack1 2021-10-17 00:48:45 +09:00
Nobuyoshi Nakada 855db8e9ce Use __dir__ 2021-10-15 19:42:39 +09:00
Nobuyoshi Nakada c4570acc86 Refactor ordering of tests
* Split the sorting types into classes.
* Apply the same sorting to method sorting under the parallel
  test.
2021-10-04 20:46:47 +09:00
Nobuyoshi Nakada 34d6720fee Prohibit test method redefinition 2021-09-17 08:54:18 +09:00
Hiroshi SHIBATA 43f49b2d1c Fixup 455978cd13 2021-09-13 21:15:36 +09:00
Hiroshi SHIBATA ec6f04c092 Use capture_output instead of capture_io 2021-09-13 21:14:42 +09:00
Hiroshi SHIBATA 8d0315a2bb Removed unsed assertions for rubygems 2021-09-11 21:05:15 +09:00
Hiroshi SHIBATA 64e056a4c5 Drop to Ruby 1.8 related code 2021-09-11 18:10:15 +09:00