Граф коммитов

124 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun 5fafff15c6
Do not run drb SSL tests on Windows
These tests often cause a timeout and this issue seems specific to the
Windows platforms.
https://github.com/ruby/ruby/actions/runs/3603761925/jobs/6072346738
2022-12-02 10:49:56 -08:00
Takashi Kokubun 1284baec12
Skip TestDRbSSLAry on mswin
This doesn't seem to stably work on mswin:
https://github.com/ruby/ruby/actions/runs/3505363753/jobs/5871633211

For CI stability, it generally seems like a bad idea to run druby tests
on Windows, given that it's pretty much unstable on MinGW as well.
2022-11-19 21:14:08 -08:00
Takashi Kokubun 6ad6994457
Omit a DRb test on MinGW
This test seems to leak a thread and let TestIOWait fail:
https://github.com/ruby/ruby/actions/runs/3065426880/jobs/4949517274

DRb almost never seemed to stably work on MinGW. I don't think we intend
to fix it either. We should just omit DRb tests when they fail on MinGW.
2022-09-16 17:05:59 +09:00
Hiroshi SHIBATA 8cd6f2a087
omit random failure tests with FreeBSD
http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20220906T043002Z.fail.html.gz
  http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20220905T103002Z.fail.html.gz
2022-09-06 16:27:12 +09:00
Takashi Kokubun 881bc2a176
Skip running a DRb test on MinGW
It hangs even after a retry
https://github.com/ruby/ruby/runs/7966439530?check_suite_focus=true

We contacted GitHub Suppport about this before, and we concluded that
the problem is on our end. Unfortunately we don't have a bandwidth to
fix this MinGW problem, so until we get to work on it, this should be
just skipped to avoid a sporadic CI timeout.
2022-08-25 11:37:39 -07:00
Takashi Kokubun 1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Hiroshi SHIBATA f6c3228794 [ruby/drb] Use omit instead of skip for test-unit
https://github.com/ruby/drb/commit/0da149e7a9
2021-09-28 17:31:08 +09:00
Yusuke Endoh fbbc37dc1d test/drb/test_drb.rb: Specify the host of DRbServer
to try fixing the following error.

http://rubyci.s3.amazonaws.com/opensuseleap/ruby-master/log/20210407T063004Z.log.html.gz
```
[  605/21105] DRbTests::TestDRbSSLAry#test_06_next/home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/drb.rb:1138:in `method_missing': undefined method `regist' for [1, 2, "III", 4, "five", 6]:Array (NoMethodError)
	from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/extserv.rb:21:in `block in initialize'
	from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/.ext/common/monitor.rb:202:in `synchronize'
	from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/.ext/common/monitor.rb:202:in `mon_synchronize'
	from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/extserv.rb:20:in `initialize'
	from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/test/drb/ut_array_drbssl.rb:35:in `new'
	from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/test/drb/ut_array_drbssl.rb:35:in `<main>'
 = 100.05 s
```

Here is my analysis:
The test of drb used both `druby://:0` and `druby://localhost:0` for
DRbServer. However, the former listens on IPv4, and the latter does on
IPv6, depending on environments. The port 0 is automatically assigned,
but sometimes the same port is used to both because they are different
protocols (IPv4 and IPv6). In this case, their URIs are resolved to the
completely same one (`druby://localhost:port`), which confuses the
method `DRb.here?` which determines the DRbObject is remote or local.

This changeset uses `druby://localhost:0` consistently.
2021-04-07 16:34:19 +09:00
Kazuhiro NISHIYAMA 31ba817887
Try to fix Leaked file descriptor
https://github.com/ruby/ruby/runs/2274767991?check_suite_focus=true#step:15:118
```
Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 7 : #<TCPServer:fd 7, AF_INET, 0.0.0.0, 42451>
Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 9 : #<IO:fd 9>
Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 10 : #<IO:fd 10>
```
2021-04-06 16:03:20 +09:00
Takashi Kokubun e1fee7f949
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.

[Feature #17490]
2021-01-13 22:46:51 -08:00
Benoit Daloze b4ec4a41c2 Guard all accesses to RubyVM::MJIT with defined?(RubyVM::MJIT) &&
* Otherwise those tests, etc cannot run on alternative Ruby implementations.
2020-12-04 16:45:54 +01:00
Hiroshi SHIBATA 7473b4c106
Explicitly loading with envutil.rb 2020-05-28 14:41:08 +09:00
Yusuke Endoh 962c302a1a test/drb/test_drbssl.rb: skip LeakChecker as openssl keeps /dev/random
and /dev/urandom intentionally.  OpenSSL::PKey::RSA.new opens the two
random generators and keeps the file descriptors.

93f99b681a/crypto/rand/rand_unix.c (L674)

They are detected by the LeakChecker as fd leak, but it is intentional.

http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20200526T160005Z.log.html.gz
```
[  597/20199] DRbTests::TestDRbSSLAry#test_01 = 0.29 s
Leaked file descriptor: DRbTests::TestDRbSSLAry#test_01: 8 #<File::Stat dev=0x6, ino=11, mode=020666, nlink=1, uid=0, gid=0, rdev=0x109, size=0, blksize=4096, blocks=0, atime=2020-05-23 14:45:13.751999995 +0000, mtime=2020-05-23 14:45:13.751999995 +0000, ctime=2020-05-23 14:45:13.751999995 +0000>
Leaked file descriptor: DRbTests::TestDRbSSLAry#test_01: 9 #<File::Stat dev=0x6, ino=10, mode=020666, nlink=1, uid=0, gid=0, rdev=0x108, size=0, blksize=4096, blocks=0, atime=2020-05-23 14:45:13.755999995 +0000, mtime=2020-05-23 14:45:13.755999995 +0000, ctime=2020-05-23 14:45:13.755999995 +0000>
```
2020-05-27 02:07:38 +09:00
Takashi Kokubun d8fcc67642
Skip test_06_timeout for --jit-wait CI
This test has been too unstable on trunk-mjit-wait
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2782206
2020-03-08 22:34:33 -07:00
Yusuke Endoh fb472ca7ad lib/drb/drb.rb: Use ruby2_keywords for keyword separation
[Bug #16634]
2020-02-15 16:27:03 +09:00
Kazuhiro NISHIYAMA beb59c3b45
Add GC guard
Try to fix infrequent error:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris10-sunc/ruby-master/log/20200108T010004Z.fail.html.gz
```
  1) Error:
DRbTests::TestDRbSSLCore#test_02_basic_object:
RangeError: "348" is recycled object
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:366:in `_id2ref'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:366:in `to_obj'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1537:in `to_obj'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1856:in `to_obj'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:620:in `recv_request'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:931:in `recv_request'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1665:in `init_with_client'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1677:in `setup_message'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1641:in `perform'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1734:in `block (2 levels) in main_loop'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1730:in `loop'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1730:in `block in main_loop'
    /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/test/drb/drbtest.rb:163:in `test_02_basic_object'
```
2020-01-08 12:26:48 +09:00
Kazuhiro NISHIYAMA 7be550d046
Stop Thread.new in `DRb::TimerIdConv::TimerHolder2#on_gc`
and add more stop_pool after stop_service
2019-12-10 12:43:49 +09:00
Kazuhiro NISHIYAMA 88ee375dd6
Revert "Add debug option to check ci failures on solaris"
This reverts commit f289e3994b.
2019-12-05 09:44:09 +09:00
Kazuhiro NISHIYAMA a0bc0e1ba1 Fix thread leak in drb 2019-12-04 20:57:24 +09:00
Jeremy Evans ffd0820ab3 Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
2019-11-18 01:00:25 +02:00
Jeremy Evans d5744aff3a Fix DRbServer#any_to_s
My previous fix in d0ed935d5b was
not correct, as pointed out by cremno on GitHub.

This simplifies things by just using Kernel#to_s.  Also switch to
bind_call(obj) instead of bind(obj).call for better performance.
2019-10-16 12:51:13 -07:00
Jeremy Evans 567e312d1f Do not raise an exception on a closed DRb socket
This rescues some exceptions that could happen with a closed or
shutdown DRb socket. This can prevent the server from
exiting if an client socket is closed directly after it is
accepted.

Fixes [Bug #8039]
2019-10-16 12:51:13 -07:00
Jeremy Evans d0ed935d5b Fix some DRb issues (#2552)
* Handle BasicObject in drb

Also fix a bug in rescue clause of any_to_s because sprintf
does not handle the %l modifier.

Fixes [Bug #7833]

* Do not send a reply to the client if there is a connection error

This allows for normal TCP shutdown (fin-ack-fin-ack instead of
fin-ack-push-rst).

Patch from pierre@mouraf.org (Pierre-Alexandre Meyer).

Fixes [Bug #2339]

* Detect fork and do not reuse forked connections in drb

This associates each DRbConn with a pid, and if the pid changes,
it closes any DRbConns in the pool with a pid that no longer
matches.  This fixes DRb servers from sending messages intended
for one client to another client after forking.

Fixes [Bug #2718]
Fixes [Bug #14471]
2019-10-14 14:20:32 +09:00
Yusuke Endoh 53a7abe2cd test/drb/drbtest.rb: Skip test_06_timeout on Solaris10s
The test seems to have a race condition, which fails on very slow
machine like Solaris10s.  So skip it.

In addition, this change restores timeout guard that was removed at
0660d7cb53.  This is because the test gets
stuck forever when something wrong occurs.  It is better to fail the
test than stuck.
2019-09-02 22:33:27 +09:00
Yusuke Endoh 007d6d15f4 test/drb/drbtest.rb: Use EnvUtil.timeout for timeout scale factor 2019-09-01 23:29:39 +09:00
Yusuke Endoh 188c2b67c9 Revert "Revert "Revert "Skip BUGs on Solaris"""
This reverts commit 3be3948870.

The Solaris environment couldn't lookup the hostname itself by a wrong
setting.  Now it is fixed, so try again.
2019-09-01 23:27:44 +09:00
Yusuke Endoh 3be3948870 Revert "Revert "Skip BUGs on Solaris""
This reverts commit 84dca8eff0.

"exceution expired" occurred on Solaris.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190901T072504Z.fail.html.gz
2019-09-01 18:57:40 +09:00
Yusuke Endoh 84dca8eff0 Revert "Skip BUGs on Solaris"
This reverts commit 8adefd4cf2.

I couldn't see any failure on Solaris if the guard is removed.
Give it a try.
2019-09-01 15:16:19 +09:00
Masatoshi SEKI 848edb03f8 ignore test_RangeError 2019-05-04 23:32:13 +09:00
Masatoshi SEKI 8980b53a48 add DRb::WeakIdConv (Bug #15711) 2019-05-04 19:28:57 +09:00
Masatoshi SEKI 68e3f8192b add DRbObject dereference test (Preparation for investigation of Bug #15711) 2019-04-25 01:08:54 +09:00
naruse 0660d7cb53 Just skip on armv7l-linux
it seems ssl.close doesn't cause EOFError on client side, but just skip
because it breaks test-all.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-03 23:08:08 +00:00
naruse df58e74e02 Add timeout
it breaks armv7 CI.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 13:30:48 +00:00
kazu 8adefd4cf2 Skip BUGs on Solaris
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 15:05:09 +00:00
kazu f289e3994b Add debug option to check ci failures on solaris
failed to start extserv?:
- https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20181020T132506Z.fail.html.gz

BUG in sysread of OpenSSL:
- https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20181020T132408Z.fail.html.gz
- https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20181020T131807Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 12:21:19 +00:00
kazu 4757c7eead Run background threads while testing drb
Do not start background thread on load test/drb/drbtest.rb,
and stop threads on each test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 13:14:02 +00:00
nobu d83e02017e drb: use \A and \z
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-30 12:10:43 +00:00
kazu 76897dbabb Fix r60271
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 14:22:04 +00:00
knu e9d9f78483 Add a new test case for ipaddr 1.2.0 + drb/acl
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 13:34:22 +00:00
knu 49ce3ca374 Make ACL::ACLEntry not suppress IPAddr::InvalidPrefixError
This is because it would be a user error because a pattern containing
a slash shouldn't be a host name pattern but an IP address pattern.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 09:53:52 +00:00
kazu 310e91f505 Remove unused test files related `$SAFE>=2`
unused since r14024

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-09 11:20:00 +00:00
nobu c57eb143ec test_drb.rb: removed extra spaces
* test/drb/test_drb.rb (TestDRbLarge#test_02_large_ary): removed
  unnecessary extra spaces which make the following parentheses an
  expression.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-26 00:07:41 +00:00
nobu 08e74bfa2c use dedicated assertions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07 13:26:12 +00:00
rhe 63abe00785 openssl: adapt OpenSSL::PKey to OpenSSL 1.1.0 opaque structs
* ext/openssl/openssl_missing.[ch]: Implement EVP_PKEY_get0_*() and
  {RSA,DSA,EC_KEY,DH}_get0_*() functions.
  OpenSSL 1.1.0 makes EVP_PKEY/RSA/DSA/DH opaque. We used to provide
  setter methods for each parameter of each PKey type, for example
  PKey::RSA#e=, but this is no longer possible because the new API
  RSA_set0_key() requires the 'n' at the same time. This commit adds
  deprecation warning to them and adds PKey::*#set_* methods as direct
  wrapper for those new APIs. For example, 'rsa.e = 3' now needs to be
  rewritten as 'rsa.set_key(rsa.n, 3, rsa.d)'.
  [ruby-core:75225] [Feature #12324]

* ext/openssl/ossl_pkey*.[ch]: Use the new accessor functions. Implement
  RSA#set_{key,factors,crt_params}, DSA#set_{key,pqg}, DH#set_{key,pqg}.
  Emit a warning with rb_warning() when old setter methods are used.

* test/drb/ut_array_drbssl.rb, test/drb/ut_drb_drbssl.rb,
  test/rubygems/test_gem_remote_fetcher.rb: Don't set a priv_key for DH
  object that are used in tmp_dh_callback. Generating a new key pair
  every time should be fine - actually the private exponent is ignored
  in OpenSSL >= 1.0.2f/1.0.1r even if we explicitly set.
  https://www.openssl.org/news/secadv/20160128.txt

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-05 15:00:47 +00:00
seki 021e8ead5c use finalizer trick instead of thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 11:03:43 +00:00
seki e143a74191 don't use keeper thread. [Bug #12342]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-15 11:59:00 +00:00
nobu 434fc4c8a0 drbtest.rb: make command an array
* test/drb/drbtest.rb (DRbService): make @@ruby an array to be
  consistent with r35424.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-12 04:24:10 +00:00
nobu c2e998d6a3 additional math operations
* test/drb/ut_large.rb (multiply, avg, median): add additional
  math operations to DRbLarge.  [Fix GH-1086]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-31 03:34:21 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00