diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-10-13 22:20:32 -0700 |
---|---|---|
committer | Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> | 2019-10-14 14:20:32 +0900 |
commit | d0ed935d5bf8c3fce9800742a36e44fb7f63dda4 (patch) | |
tree | cba892665fbb002f240c3363ac58d41f23922ed5 /test | |
parent | 95c420c4a65ca2e7f3edf27134ad33691959296c (diff) |
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]
Diffstat (limited to 'test')
-rw-r--r-- | test/drb/drbtest.rb | 8 | ||||
-rw-r--r-- | test/drb/ut_drb.rb | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb index 9ac3e08cdf..6b8cd5d3e5 100644 --- a/test/drb/drbtest.rb +++ b/test/drb/drbtest.rb @@ -158,6 +158,14 @@ module DRbCore end end + def test_02_basic_object + obj = @there.basic_object + assert_kind_of(DRb::DRbObject, obj) + assert_equal(1, obj.foo) + assert_raise(NoMethodError){obj.prot} + assert_raise(NoMethodError){obj.priv} + end + def test_02_unknown obj = @there.unknown_class assert_kind_of(DRb::DRbUnknown, obj) diff --git a/test/drb/ut_drb.rb b/test/drb/ut_drb.rb index 6a94a0fb40..b1306d0cb0 100644 --- a/test/drb/ut_drb.rb +++ b/test/drb/ut_drb.rb @@ -63,6 +63,15 @@ class DRbEx FooBar.new end + class BO < ::BasicObject + def foo; 1 end + protected def prot; 2; end + private def priv; 3; end + end + def basic_object + BO.new + end + def unknown_class Unknown2.new end |