Bug #7311

DRb test suite fails when hostname cannot be reached

Added by Vit Ondruch over 1 year ago. Updated 10 months ago.

[ruby-core:49101]
Status:Assigned
Priority:Normal
Assignee:Masatoshi Seki
Category:-
Target version:next minor
ruby -v:ruby 2.0.0dev (2012-11-07 trunk 37538) [x86_64-linux] Backport:

Description

=begin
I have set following hostname:

$ hostname
dhcp-25-70

However, it cannot be reached:

$ ping hostname
PING dhcp-25-70 (10.34.25.70) 56(84) bytes of data.
From dhcp-25-1 (10.34.25.1) icmpseq=1 Destination Host Unreachable
From dhcp-25-1 (10.34.25.1) icmp
seq=2 Destination Host Unreachable
From dhcp-25-1 (10.34.25.1) icmpseq=3 Destination Host Unreachable
From dhcp-25-1 (10.34.25.1) icmp
seq=4 Destination Host Unreachable

This causes that the DRb test suite fails:

TestDRbAry#test01 = 3.16 s = E
TestDRbAry#test
02collect = 3.01 s = E
TestDRbAry#test
03redo = 3.01 s = E
TestDRbAry#test
05break = 3.01 s = E
TestDRbAry#test
06next = 3.01 s = E
TestDRbAry#test
07break18 = 3.01 s = E
TestDRbCore#test00DRbObject = 0.15 s = .
TestDRbCore#test01 = 2.85 s = E
TestDRbCore#test
0102loop = 3.00 s = E
TestDRbCore#test02unknown = 3.01 s = F
TestDRbCore#test03 = 0.16 s = .
TestDRbCore#test
04 = 0.16 s = .
TestDRbCore#test05eq = 0.15 s = .
TestDRbCore#test06timeout = 0.36 s = .
TestDRbCore#test07publicprivateprotectedmissing = 0.16 s = .
TestDRbCore#test
08here = 0.16 s = .
TestDRbCore#test
09option = 0.16 s = .
TestDRbCore#test
10yield = 1.70 s = E
TestDRbCore#test
10yieldundumped = 3.17 s = E
TestDRbCore#test11remotenomethoderror = 0.16 s = .
TestDRbLarge#test
01largeary = 0.05 s = .
TestDRbLarge#test02largeary = 0.06 s = .
TestDRbLarge#test
03largeary = 2.63 s = E
TestDRbLarge#test04manyarg = 0.05 s = .
TestDRbLarge#test
05toolargeary = 0.07 s = .
TestDRbMServer#test
01 = 2.88 s = E
TestDRbRuby18Yield#test01one = 0.00 s = .
TestDRbRuby18Yield#test02two = 0.00 s = .
TestDRbRuby18Yield#test03many = 0.00 s = .
TestDRbRuby18Yield#test04manytoone = 0.00 s = .
TestDRbRuby18Yield#test05arraysubclass = 0.00 s = .
TestDRbRuby18Yield#test
06taint = 0.00 s = .
TestDRbRubyYield#test
01one = 0.00 s = .
TestDRbRubyYield#test
02two = 0.00 s = .
TestDRbRubyYield#test
03many = 0.00 s = .
TestDRbRubyYield#test
04manytoone = 0.00 s = .
TestDRbRubyYield#test
05arraysubclass = 0.00 s = .
TestDRbRubyYield#test06taint = 0.00 s = .
TestDRbSSLAry#test01 = 3.09 s = E
TestDRbSSLAry#test
02collect = 3.01 s = E
TestDRbSSLAry#test
03redo = 3.01 s = E
TestDRbSSLAry#test
05break = 3.01 s = E
TestDRbSSLAry#test
06next = 3.01 s = E
TestDRbSSLAry#test
07break18 = 3.01 s = E
TestDRbSSLCore#test00DRbObject = 0.20 s = .
TestDRbSSLCore#test01 = 2.82 s = E
TestDRbSSLCore#test
0102loop = 0.22 s = .
TestDRbSSLCore#test02unknown = 0.20 s = .
TestDRbSSLCore#test03 = 0.24 s = .
TestDRbSSLCore#test
04 = 0.21 s = .
TestDRbSSLCore#test05eq = 0.23 s = .
TestDRbSSLCore#test06timeout = 0.44 s = .
TestDRbSSLCore#test07publicprivateprotectedmissing = 0.29 s = .
TestDRbSSLCore#test
08here = 0.22 s = .
TestDRbSSLCore#test
09option = 0.21 s = .
TestDRbSSLCore#test
10yield = 0.75 s = E
TestDRbSSLCore#test
10yieldundumped = 3.22 s = E
TestDRbSSLCore#test11remotenomethoderror = 0.24 s = .
TestDRbSafe1#test
01 = 0.15 s = .
TestDRbSafe1#test02collect = 2.60 s = E
TestDRbSafe1#test03redo = 3.01 s = E
TestDRbSafe1#test05break = 3.00 s = E
TestDRbSafe1#test06next = 3.01 s = E
TestDRbSafe1#test07break18 = 3.01 s = E
TestDRbUNIXAry#test
01 = 0.17 s = .
TestDRbUNIXAry#test02collect = 2.84 s = E
TestDRbUNIXAry#test03redo = 3.01 s = E
TestDRbUNIXAry#test05break = 3.01 s = E
TestDRbUNIXAry#test06next = 3.01 s = E
TestDRbUNIXAry#test07break18 = 3.01 s = E
TestDRbUNIXCore#test
00DRbObject = 0.16 s = .
TestDRbUNIXCore#test
01 = 2.84 s = E
TestDRbUNIXCore#test0102loop = 0.17 s = .
TestDRbUNIXCore#test
02unknown = 0.16 s = .
TestDRbUNIXCore#test
03 = 0.17 s = .
TestDRbUNIXCore#test04 = 0.16 s = .
TestDRbUNIXCore#test
05eq = 0.16 s = .
TestDRbUNIXCore#test
06timeout = 0.37 s = .
TestDRbUNIXCore#test
07publicprivateprotectedmissing = 0.17 s = .
TestDRbUNIXCore#test08here = 0.17 s = .
TestDRbUNIXCore#test09option = 0.17 s = .
TestDRbUNIXCore#test10yield = 1.29 s = E
TestDRbUNIXCore#test10yieldundumped = 3.17 s = E
TestDRbUNIXCore#test
11remotenomethoderror = 0.17 s = .
TestDRbYield#test01one = 2.73 s = E
TestDRbYield#test02two = 3.01 s = E
TestDRbYield#test03many = 3.01 s = E
TestDRbYield#test04manytoone = 3.01 s = E
TestDRbYield#test05arraysubclass = 3.01 s = E
TestDRbYield#test
06_taint = 3.01 s = E

So there are two possible ways how to fix this issue.

(1) Enforce usage of localhost in test suite (0001-Enforce-localhost-for-DRb-tests.patch). Unfortunately it appears it does not solve my issues completely under some (not so clear) circumstances.
(2) Detect if hostname is associated with some IP address of my computer, otherwise fallback to localhost (0001-Fallback-to-localhost-if-hostname-is-not-associated-.patch). This resolves my issue completely.

BTW this test error later causes deadlock in TestProcess test suite [1], which is nasty :/

[1] https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L12
=end

0001-Enforce-localhost-for-DRb-tests.patch Magnifier - Fix the test suite by enforcing localhost (1.66 KB) Vit Ondruch, 11/08/2012 11:03 PM

0001-Fallback-to-localhost-if-hostname-is-not-associated-.patch Magnifier - Fallback to localhost if hosntame is not associated with IP (718 Bytes) Vit Ondruch, 11/08/2012 11:03 PM

Associated revisions

Revision 41916
Added by Zachary Scott 10 months ago

  • test/drb/ut_eq.rb: Use localhost for drb tests [Bug #7311] Patch by Vit Ondruch
  • test/drb/ut_array.rb: ditto
  • test/drb/utarraydrbssl.rb: ditto

History

#1 Updated by Yusuke Endoh over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Masatoshi Seki
  • Target version set to 2.0.0

Seki-san, Urabe-san, Naruse-san, what do you think?

Yusuke Endoh mame@tsg.ne.jp

#2 Updated by Yusuke Endoh about 1 year ago

  • Target version changed from 2.0.0 to next minor

Just an issue of test.

Yusuke Endoh mame@tsg.ne.jp

#3 Updated by Vit Ondruch about 1 year ago

It is not just test suite issue. See 0001-Fallback-to-localhost-if-hostname-is-not-associated-.patch

Although it is pretty minor issue, due to other bugs in Gnome 3, it forces me to reboot quite often :/ But anyway, it is not blocker.

#4 Updated by Vit Ondruch 10 months ago

Could somebody please review and apply the patches? They are just a few lines of code. Thanks

#5 Updated by Zachary Scott 10 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41916.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • test/drb/ut_eq.rb: Use localhost for drb tests [Bug #7311] Patch by Vit Ondruch
  • test/drb/ut_array.rb: ditto
  • test/drb/utarraydrbssl.rb: ditto

#6 Updated by Vit Ondruch 10 months ago

  • Status changed from Closed to Open
  • % Done changed from 100 to 50

Thanks for applying. However, there is also 0001-Fallback-to-localhost-if-hostname-is-not-associated-.patch attached, which does not look to be applied. Could you please review? Thanks.

#7 Updated by Zachary Scott 10 months ago

  • Status changed from Open to Assigned

I don't like the patch, maybe seki-san can review it.

seki: please check 0001-Fallback-to-localhost-if-hostname-is-not-associated-.patch

Also available in: Atom PDF