Commit graph

209 commits

Author SHA1 Message Date
Takashi Kokubun
067f45ecd3
Save a core file on a worker crash
CI failures like
http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/3280458 doesn't
provide any useful information, and it doesn't leave a core file in a CI
environment because a test like `Process.kill(:TRAP, $$)` overwrites in
a next run very quickly.

Thus I'd like to keep core files in /tmp.
2020-12-03 21:01:25 -08:00
Takashi Kokubun
0734a6cd59
Revert "Report a full_message on a worker crash"
This reverts commit 00f046ef57.
It was not helpful for an issue I was debugging.
2020-12-03 20:55:36 -08:00
Koichi Sasada
e79f1941b2 tune parallel test
This patch contains the fowllowing hacks:

(1) Add "--timetable-data=FILE" option for test-all
    This option enables to dump timeline event
    contains worker, suite, and start/end time.
(2) remove TestJIT in test_jit_debug.rb on parallel test.
    it is duplicated test.
(3) move test_jit.rb and test_jit_debug.rb at first
    because these two tests are bottleneck of parallel tests.

On my environment, `make test-all TESTS=-j12` reduced the total time
190 seconds -> 140 seconds.
2020-12-01 09:39:09 +09:00
Takashi Kokubun
00f046ef57
Report a full_message on a worker crash
A worker crash happens very often, but we're not sure why.
I'd like to know a backtrace if it's available.
2020-11-24 20:36:39 -08:00
Koichi Sasada
7ad56fd87b freeze dynamic regexp literals
Regexp literals are frozen, and also dynamically comppiled Regexp
literals (/#{expr}/) are frozen.
2020-10-27 01:45:57 +09:00
Hiroshi SHIBATA
533bca57e0
Expose assert, assert_respond_to and assert_not_respond_to for default gems. 2020-10-08 16:40:46 +09:00
Nobuyoshi Nakada
9fbbbadc96
Added just working Test::Unit::CoreAssertions#diff
This is not "diff", but show expected and actual results both,
just to get rid of `NoMethodError` when an assertion failed.
2020-09-14 18:19:40 +09:00
Hiroshi SHIBATA
59ded36c60
Expose assert_pattern_list for drb test with test-unit gem. 2020-07-02 20:53:42 +09:00
Nobuyoshi Nakada
968d6df49f
Added --test-order=nosort option
Run tests in the order given in the command line.
2020-05-17 16:34:06 +09:00
Nobuyoshi Nakada
2e87488d13
Expand retrying test file names to realpath
As well as worker processes do in Test::Unit::Worker#run.
2020-04-23 10:25:09 +09:00
Nobuyoshi Nakada
3152977b31
Rescue EPIPE in _report
Instead of letting callers rescue the error always.
2020-04-17 14:25:20 +09:00
Nobuyoshi Nakada
3cca0d1958 core_assertions.rb: fixed fd leak at timeout 2020-04-17 00:52:29 +09:00
卜部昌平
f7048f9d55 tool/lib/test/unit: support TESTS='-- -ext-' again
There is a test directory named test/-ext-.  Because this directry
starts with a hyphen, we have to cheat test/unit in order for it to
run the tests underneath.  TESTS='-- -ext' worked for a long time.
Let's not break that maneuver.
2020-03-04 12:30:42 +09:00
Koichi Sasada
413c98003b show backtrace.
assert_nothing_raised doesn't show the backtrace if an exception
is thrown in a block. This patch shows this backtrace.
2020-03-01 03:02:05 +09:00
Koichi Sasada
28399e4e0f respect --test-order=random
Now --test-order=random is simply ignored. This patch respect
this option.
2020-02-28 17:44:23 +09:00
Koichi Sasada
116c632095 don't ignore --seed option
`--seed N` option is just ignored so respect this option.
[Feature #16655]

Also making "Run options" display pretty.
2020-02-27 02:26:14 +09:00
Hiroshi SHIBATA
9b2e671944 Expose assert_no_memory_leak for weakref 2020-02-11 13:29:23 +09:00
Hiroshi SHIBATA
a5d7b8e13d Expose assert_normal_exit for weakref 2020-02-11 13:29:23 +09:00
Nobuyoshi Nakada
a3fb97465d
Stop auto runner
Auto runner should not run in forked processes in separated tests.
2020-02-07 13:43:50 +09:00
Nobuyoshi Nakada
3d21a75c72
No crafted backtrace for SystemExit
As SystemExit is ignored, it is just useless.
2020-02-07 11:09:19 +09:00
Nobuyoshi Nakada
5fac54a594
Fixed the output from separated test in parallel test
Redirect the output of separated child process to
`MiniTest::Unit.output`.
2020-02-06 20:53:11 +09:00
Nobuyoshi Nakada
f1c230f18b
Add separated assertion count 2020-02-06 20:52:25 +09:00
Nobuyoshi Nakada
0226d72e95
Fixed the output from separated test in parallel test
To output to the STDOUT of the parent process according to the
parallel test protocol, should send to the `MiniTest::Unit.output`
instead of each own STDOUT.
2020-02-05 09:39:14 +09:00
Nobuyoshi Nakada
6fe44576b9
Fixed FD leaks 2020-02-05 09:30:12 +09:00
Nobuyoshi Nakada
c6cd4206df
Get rid of nested string interpolations to be editor-friendly 2020-02-05 08:53:21 +09:00
NARUSE, Yui
390a9d3b72 just use STDOUT 2020-02-04 21:51:57 +09:00
NARUSE, Yui
9b9a621ae3 On Windows it cannot receive fd except 0..2 2020-02-04 20:54:48 +09:00
NARUSE, Yui
0529fead36 assert_separately uses their own pipe instead of stdout 2020-02-04 19:30:11 +09:00
卜部昌平
12de92a368 implement make test-all TESTS=--gc-compact
79eb5e1aca implemented
RUBY_TEST_GC_COMPACT=1 so why not make it also possible via the command
line argument.
2019-12-12 11:13:42 +09:00
Koichi Sasada
27ac034f19 support gc_compact_checker on parallel test. 2019-12-12 04:27:06 +09:00
Yusuke Endoh
409e4ab740 tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io
`(ulimit -n 30; make test-tool)` fails with unexplicit message:
"undefined method `write' for nil:NilClass" due to lack of stdout.

This change makes it explicit.  [Bug #5577]
2019-12-03 17:26:12 +09:00
David Rodríguez
a2fc6a51dd [ruby/fileutils] Fix test failure under ruby 2.4
`Exception#full_message` is only defined on ruby 2.5.0 and above.

a8968f41ed
2019-12-01 08:23:05 +09:00
David Rodríguez
fa0f3eff22 [ruby/fileutils] Fix error printing test failure
`exception_details` is not defined anywhere.

This commit fixes the following test crash in ruby 2.4

```
Error: test_assert_output_lines(TestFileUtils): NoMethodError: undefined method `exception_details' for #<TestFileUtils:0x00005556ef699178>
```

And replaces it with an actual test failure:

```
[Test::Unit::CoreAssertions::MiniTest::Assertion] exception expected, not #<NoMethodError: undefined method `full_message' for #<RuntimeError: ok>
Did you mean?  message>.
```

2f38ba6e82
2019-12-01 08:22:37 +09:00
Kazuhiro NISHIYAMA
50bc7e7e9f
Add debug print
http://ci.rvm.jp/results/trunk-mjit@silicon-docker/2380788
```
test_all             #<Thread:0x000055b6c8e9fca8@/tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:42 run> terminated with exception (report_on_exception is true):
<internal:pack>:134:in `pack': no implicit conversion of false into String (TypeError)
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:160:in `_report'
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:45:in `block in _run_suite'
```
2019-11-09 15:20:52 +09:00
Hiroshi SHIBATA
1c03026ea3 Try to run assert_output_unchanged with racc tests 2019-10-31 08:39:48 +09:00
Nobuyoshi Nakada
601f1fb456
Catch syntax error even if fatal 2019-10-23 02:05:28 +09:00
Nobuyoshi Nakada
f8fb51c976
Revert "alias assert_raise_message for compatibility with test-unit"
This reverts commit 43015275b9.

`assert_raise_message` in test-unit is different from
`assert_raise_with_message`.  It checks the exception message
only, but not the exception class,
2019-10-16 21:00:36 +09:00
Nobuyoshi Nakada
43015275b9
alias assert_raise_message for compatibility with test-unit 2019-10-16 17:44:51 +09:00
Hiroshi SHIBATA
c14755e9ca
[ruby/fileutils] improve the compatibility of minitest
f16f5a0dd6
2019-10-03 18:32:21 +09:00
卜部昌平
84fc1de512 use bind_call for test-all --gc-stress
This one allocation of Method object is worth avoiding.  We don't
want to test UnboundMethod#bind right here.  GC need not run.
2019-10-03 15:24:09 +09:00
Koichi Sasada
84cbce3d88 Enable checkers on parallel test.
parallel test (`make test-all TESTS=-j8`) runs tests on specified
number of processes. However, some test checkers written in
`runner.rb` are not loaded. This fix enable these checkers on
parallel tests.

See also: https://github.com/ruby/ruby/pull/2508
2019-10-02 16:23:00 +09:00
Hiroshi SHIBATA
15606963de expose assert_raise and assert_join_threads 2019-10-01 22:19:18 +09:00
Nobuyoshi Nakada
03284fb911
assert_in_out_err should use FailDesc too 2019-09-27 21:07:53 +09:00
SHIBATA Hiroshi
216d230080
Move some assertions to CoreAssertions. (#2354)
They are used by default gems like forwardable.

    * assert_raise_with_message
    * assert_warning
    * assert_warn
2019-08-14 07:44:26 +09:00
Kazuhiro NISHIYAMA
f731cc0984
Use end_with? instead of Regexp with missing escape 2019-08-11 10:15:05 +09:00
Koichi Sasada
3cbd56d574 complement test_ prefix.
`make test-all TESTS=name` can specify running test files by name.
name can be dirname ('dir/') or a file ('.../test_foo.rb'). This
patch complement `test_` prefix for a test. So we only need to
specify `TESTS=ruby/hash` which means `TESTS=ruby/test_hash.rb`.
2019-08-09 16:08:15 +09:00
Nobuyoshi Nakada
29092d35d3
Moved FailDesc to EnvUtil.failure_description
So EnvUtil does not depends on test/unit.
2019-08-05 10:48:49 +09:00
Hiroshi SHIBATA
d569d721f9
Move assert_ruby_status and assert_throw to CoreAssertions for default gems. 2019-08-03 22:17:45 +09:00
Hiroshi SHIBATA
eb638b75b3
It can be share to use CoreAssertions for default gems.
ref. https://github.com/ruby/logger/pull/35
2019-08-02 21:09:43 +09:00
Nobuyoshi Nakada
46771abfe5
Use libraries in the base directory if given 2019-07-25 16:57:37 +09:00