Commit graph

16449 commits

Author SHA1 Message Date
Hiroshi SHIBATA
f3bda8987e
Merge the master branch of rubygems repo
Picked from 4b498709a0
2021-11-16 20:19:13 +09:00
Jeremy Evans
fceaa6886b Sync test_http_request.rb after fix to net-http 2021-11-15 09:31:44 -08:00
Jeremy Evans
f1c3fc273d [ruby/net-http] Fix tests after change to allow HEAD to send Accept-Encoding
ca7bb8c51c
2021-11-16 02:21:57 +09:00
Yusuke Endoh
ca0a5edb5f test/ruby/test_m17n.rb: skip a test that breaks another test
See https://bugs.ruby-lang.org/issues/18338
2021-11-15 16:53:49 +09:00
Yusuke Endoh
f9638c3b17 Revert "test/ruby/test_m17n.rb: Run a test under assert_separately"
This reverts commit a698181021.

It failed on macos for a unknown problem.
```
    1) Error:
  TestM17N#test_object_inspect_external:
  Encoding::ConverterNotFoundError: code converter not found (US-ASCII to UTF-16BE)
      /Users/runner/work/ruby/ruby/src/test/ruby/test_m17n.rb:312:in `encode'
      /Users/runner/work/ruby/ruby/src/test/ruby/test_m17n.rb:312:in `inspect'
      /Users/runner/work/ruby/ruby/src/test/ruby/test_m17n.rb:315:in `inspect'
      /Users/runner/work/ruby/ruby/src/test/ruby/test_m17n.rb:315:in `<main>'
      /Users/runner/work/ruby/ruby/src/test/ruby/test_m17n.rb:299:in `test_object_inspect_external'
```
4207871418
2021-11-15 15:21:24 +09:00
Yusuke Endoh
a698181021 test/ruby/test_m17n.rb: Run a test under assert_separately
The test uses `Encoding.default_external = Encoding::UTF_16BE`, which
may add a wrongly UTF_16BE-encoded path to $LOADED_FEATURES (depending
on the order of tests). Unfortunately this breaks another test:

http://ci.rvm.jp/results/trunk-test@ruby-sky1/3711615
```
/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:11:in `===': incompatible encoding regexp match (US-ASCII regexp with UTF-16BE string) (Encoding::CompatibilityError)
```

According to @naruse-san, we don't pay effort to such a case, so this
change just avoids the issue by running the test in question under
another process.

Co-Authored-By: Koichi Sasada <ko1@atdot.net>
2021-11-15 14:13:20 +09:00
Koichi Sasada
38c555a315 show encoding for each path 2021-11-14 02:41:30 +09:00
Yusuke Endoh
4d8d8c9d49 test/io/console/test_io_console.rb: dump debug output to stderr
make test-all in parallel mode seems to hide stdout
2021-11-14 02:35:03 +09:00
Yusuke Endoh
61938e2db5 test/ruby/test_jit.rb: suppress a false-positive warning
It reports "opt_regexpmatch2 insn is not included", but actually it is
included. This is due to a known bug of ISeq#to_a on which this check
depends.

https://bugs.ruby-lang.org/issues/18269
2021-11-12 16:40:49 +09:00
Yusuke Endoh
3aa62b455c test/io/console/test_io_console.rb: add debug code
to debug the following failure

http://ci.rvm.jp/results/trunk-test@ruby-sky1/3708240
```
/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `===': incompatible encoding regexp match (US-ASCII regexp with UTF-16BE string) (Encoding::CompatibilityError)
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `each'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `grep'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `<class:TestIO_Console>'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:9:in `<top (required)>'
	<internal:/tmp/ruby/v3/src/trunk-test/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
	<internal:/tmp/ruby/v3/src/trunk-test/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
	/tmp/ruby/v3/src/trunk-test/tool/lib/test/unit/parallel.rb:122:in `run'
	/tmp/ruby/v3/src/trunk-test/tool/lib/test/unit/parallel.rb:211:in `<main>'
running file: /tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb
```
2021-11-12 16:23:00 +09:00
Samuel Williams
c833ece5f7 Rework implementation of IO::Buffer.for(string) to use string locking. 2021-11-12 16:46:08 +13:00
Samuel Williams
98b442e013 More immutability and locking tests. 2021-11-12 16:46:08 +13:00
Peter Zhu
84202963c5 [Bug #18329] Fix crash when calling non-existent super method
The cme is NULL when a method does not exist, so check it before
accessing the callcache.
2021-11-11 14:08:38 -05:00
Matt Valentine-House
c53aecee3b fix a memory leak introduced in 8bbd319
This commit fixes a memory leak introduced in an early part of the
variable width allocation project that would prevent the rb_classext_t
struct from being free'd when the class is swept.
2021-11-11 08:54:48 -05:00
Koichi Sasada
b5531adf41 quick fix for test_initialize_HEAD
52ab9bbee9 makes a failure.

```
  1) Failure:
HTTPRequestTest#test_initialize_HEAD [/tmp/ruby/v3/src/trunk/test/net/http/test_http_request.rb:53]:
<{"accept"=>["*/*"], "user-agent"=>["Ruby"]}> expected but was
<{"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],
 "accept"=>["*/*"],
 "user-agent"=>["Ruby"]}>.
```

I'm not sure it is correct, so please review later.
2021-11-11 18:04:00 +09:00
Kazuki Yamaguchi
cd51bf61a2 test/openssl/test_ssl: adjust certificate expiry date
test_connect_certificate_verify_failed_exception_message occasionally
fails. Is it possible that OpenSSL sees a different clock from Ruby by
more than 10 seconds?

http://ci.rvm.jp/logfiles/brlog.trunk-random0.20211111-072828

Let's give more time after the certificate expiration date to see if
this fixes the flakiness. We had similar occasional failures in
test_x509store.rb before, which disappeared after ruby/ruby commit
7930a352a5 and ruby/openssl commit fb2fcbb13734.
2021-11-11 17:59:22 +09:00
Hiroshi SHIBATA
155bc42727
[ruby/getoptlong] fixup 5f57f47572502173e2e8880f83ef7b3e2659f974
5683297853
2021-11-11 14:00:32 +09:00
Nobuyoshi Nakada
6ecd30b402 [ruby/getoptlong] Save the copy of ARGV
It refers the same object and will be replaced.

5f57f47572
2021-11-11 14:00:05 +09:00
Burdette Lamar
db316e627f
[ruby/getoptlong] Write a first test of getoptlong.rb
18cdb03fd4
2021-11-11 10:37:35 +09:00
Peter Zhu
d5dd87d0db [ci skip] Fix typo in test name 2021-11-10 17:14:50 -05:00
Nobuyoshi Nakada
cc33d07f46
Disable experimental warnings in test/runner.rb 2021-11-10 17:42:09 +09:00
Samuel Williams
81d0ce7e97 Mark IO::Buffer as experimental. 2021-11-10 19:21:05 +13:00
Samuel Williams
4b89034218 IO::Buffer for scheduler interface. 2021-11-10 19:21:05 +13:00
Yusuke Endoh
5c892da7d7 class.c: descendants must not cause GC until the result array is created
Follow up of 428227472f. The previous fix
uses `rb_ary_new_from_values` to create the result array, but it may
trigger the GC.

This second try is to create the result array by `rb_ary_new_capa`
before the second iteration, and assume that `rb_ary_push` does not
trigger GC. This assumption is very fragile, so should be improved in
future.

[Bug #18282] [Feature #14394]
2021-11-10 10:08:30 +09:00
David Rodríguez
0d3898ec7b [rubygems/rubygems] Remove more unused stuff from make command parsing
eba7d173d4
2021-11-09 21:21:35 +09:00
David Rodríguez
ba3dfe6efe [rubygems/rubygems] This method is never passed a block
d79ade274b
2021-11-09 21:21:34 +09:00
Jun Aruga
d713b602ea [rubygems/rubygems] Fix assert_contains_make_command on make defined by environment variable.
The `parse_make_command_line` in `assert_contains_make_command` fails to get
the make targets correctly, when the make command is set with make options by
environment variable such as `export make='make -j2'` at
lib/rubygems/ext/builder.rb::make.

So, we include the make options (eg, -XX) as a part of the command to fix the
case. Note that this commit still doesn't fix the case of
`export make='make -j 2'`.

7730ef3fa0
2021-11-09 21:21:34 +09:00
David Rodríguez
ec6352c108 [rubygems/rubygems] Improve error message when make command doesn't match
8c2725e9a6
2021-11-09 21:21:33 +09:00
Yusuke Endoh
54bda176c6 test/ruby/test_iseq.rb: Prevent a warning
20211109T063003Z.log.html.gz
```
[ 9898/21145] TestISeq#test_super_with_block_and_kwrest/home/chkbuild/chkbuild/tmp/build/20211109T063003Z/ruby/test/ruby/test_iseq.rb:1: warning: method redefined; discarding old touch
/home/chkbuild/chkbuild/tmp/build/20211109T063003Z/ruby/test/ruby/test_iseq.rb:1: warning: previous definition of touch was here
 = 0.00 s
```
2021-11-09 17:31:17 +09:00
Yusuke Endoh
cf50f9484a test/ruby/test_enum.rb: Prevent a warning
20211109T063003Z.log.html.gz
```
[ 1960/21145] TestEnumerable#test_to_a_keywords/home/chkbuild/chkbuild/tmp/build/20211109T063003Z/ruby/test/ruby/test_enum.rb:138: warning: method redefined; discarding old each
/home/chkbuild/chkbuild/tmp/build/20211109T063003Z/ruby/test/ruby/test_enum.rb:11: warning: previous definition of each was here
 = 0.00 s
```
2021-11-09 17:30:28 +09:00
Yusuke Endoh
428227472f class.c: calculate the length of Class.descendants in advance
GC must not be triggered during callback of rb_class_foreach_subclass.
To prevent GC, we can not use rb_ary_push. Instead, this changeset calls
rb_class_foreach_subclass twice: first counts the subclasses, then
allocates a buffer (which may cause GC and reduce subclasses, but not
increase), and finally stores the subclasses to the buffer.

[Bug #18282] [Feature #14394]
2021-11-09 16:11:10 +09:00
Yusuke Endoh
6cf7c0a48f test/readline/test_readline.rb: skip a test on i686-linux
... because readline library (or libtinfo) seems to cause SEGV
internally even with Readline 8.1.

This SEGV is caught as SystemStackError, which leads to a test failure.
20211109T030008Z.fail.html.gz
```
  1) Failure:
TestReadline#test_interrupt_in_other_thread [/home/chkbuild/chkbuild/tmp/build/20211109T030008Z/ruby/test/readline/test_readline.rb:568]:
Unknown failure with exit status pid 13097 exit 1
Log: ** START **Readline::VERSION is 8.1.
/home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `readline': stack level too deep (SystemStackError)
	from /home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `block in <main>'
/home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `readline': stack level too deep (SystemStackError)
	from /home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `block in <main>'
```
2021-11-09 14:52:48 +09:00
Yusuke Endoh
1290bdf1ae test/ruby/test_fiber.rb: Extend timeout on Solaris
The test usually takes 200 sec. on Solaris, so the timeout of 300 sec.
looks too short.
2021-11-09 14:39:39 +09:00
Peter Zhu
39d3d24abb [Feature #18290] Remove tests that test use of rb_gc_force_recycle
Remove tests that assume objects get force recycled.
2021-11-08 15:39:53 -05:00
Nobuyoshi Nakada
ec657f44dc Refine the error message for hidden variables 2021-11-07 12:40:27 +09:00
Nobuyoshi Nakada
334b69e504 rb_id_serial_to_id: return unregistered ID as an internal ID
```ruby
def foo(*); ->{ super }; end
```

This code makes anonymous parameters which is not registered as an
ID.  The problem is that when Ractors try to scan `getlocal`
instructions, it puts the Symbol corresponding to the parameter
in to a hash.  Since it is not registered, we end up with a
strange exception.  This commit wraps the unregistered ID in an
internal ID so that we get the same exception for `...` as `*`.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2021-11-07 12:40:27 +09:00
John Hawthorn
9cc2c74b83
YJIT: Implement checkkeyword (#5083)
Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>

Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
2021-11-05 16:54:23 -04:00
Jeremy Evans
e83c02a768 Delegate keywords from Enumerable#to_a to #each
Fixes [Bug #18289]
2021-11-05 06:22:14 -09:00
David Rodríguez
907aa47527 [rubygems/rubygems] Fix ruby setup.rb command when --prefix is passed
8d04092f6e
2021-11-05 23:20:50 +09:00
David Rodríguez
d47831d554 [rubygems/rubygems] Bin dir should fall inside destdir
Since that's what happens in real life when `--destdir` is passed.

55637bdc8a
2021-11-05 23:20:49 +09:00
David Rodríguez
ef6752c6c4 [rubygems/rubygems] Remove unnecessary test setup
The method being unit tested here doesn't use
`RbConfig::CONFIG["bindir"]`.

d3f092ad14
2021-11-05 23:20:49 +09:00
David Rodríguez
87a8b22455 [rubygems/rubygems] Simplify --destdir test
0571fd1ec6
2021-11-05 23:20:48 +09:00
David Rodríguez
e60c1f7556 [rubygems/rubygems] Refactor setup tests to not always pass --prefix
Standard usage should be tested by default. I will add a test for
`--prefix` once I fix that option since it's not working correctly at
the moment.

50a7e34586
2021-11-05 23:20:47 +09:00
Yusuke Endoh
56119c5245 Skip TestIRB::TestInit#test_recovery_sigint on Solaris
The test randomly gets stuck on Solaris:

20211105T060014Z.fail.html.gz
```
  1) Error:
TestIRB::TestInit#test_recovery_sigint:
Timeout::Error: execution of assert_in_out_err expired timeout (100.0 sec)
pid 3195 killed by SIGTERM (signal 15)
| Switch to inspect mode.
| exit
|
```

I investigated the issue but I couldn't figure it out.
This random failure is noisy, which makes it difficult to track the CI.
So I skip the test on Soalris. Contribution is welcome.
2021-11-05 20:03:11 +09:00
Nobuyoshi Nakada
f62f020f56
Add the test of Dir.glob when sort: true is given explicitly 2021-11-05 10:20:02 +09:00
Alyssa Ross
1506c8228b [rubygems/rubygems] Don't apply --destdir twice when running setup.rb
Prior to this patch, if I ran:

    ruby setup.rb --destdir /foo

Then Bundler files would be written into /foo/foo, because destdir was
being prepended, even though `bundler_spec.bin_dir` already included
destdir.

9e857ffb52
2021-11-05 07:23:36 +09:00
Yusuke Endoh
0c69f2401a test/ruby/test_gc_compact.rb: Backpatch the URL to the PR 2021-11-04 08:54:05 -07:00
Yusuke Endoh
8821a0de0e test/ruby/test_gc_compact.rb: Do not run on s390x
The compaction tests get stuck randomly on s390x for unknown reason.

20211104T030003Z.fail.html.gz
```
[13715/21145] TestGCCompact#test_gc_compact_statstimeout: output interval exceeds 1800.0 seconds.
```

We spent some time to investigate this issue, but we can't figure out
why, and it is unlikely that we'll be able to fix it anytime soon.

This random failure makes the CI unuseful, so tentatively we suppress
this test for a while. A contribution from those who are familiar with
s390x is welcome.
2021-11-04 08:54:05 -07:00
Nobuyoshi Nakada
539c42ed89 [rubygems/rubygems] Fix typos
f328ef6f77
2021-11-04 23:06:25 +09:00
Kazuki Yamaguchi
5f2c4e344d [ruby/net-http] Reset keep_alive timer on new connection
The last_communicated timestamp is for HTTP persistent connection, to
decide whether the current TCP connection may be reused for the
subsequent requests or not. Naturally, the timer must be reset if the
connection is recreated since it is no longer relevant.

0a013de42d
2021-11-04 20:44:04 +09:00