Fixes to get specs passing on Darwin and other things#6311
Merged
headius merged 17 commits intojruby:masterfrom Jul 8, 2020
Merged
Fixes to get specs passing on Darwin and other things#6311headius merged 17 commits intojruby:masterfrom
headius merged 17 commits intojruby:masterfrom
Conversation
This fixes one spec when run with command-line AOT enabled (the default): Kernel#caller returns an Array with the block given to #at_exit at the base of the stack FAILED Expected ["/spec/ruby/core/kernel/fixtures/caller_at_exit.rb:6:in `foo'\n", "/spec/ruby/core/kernel/fixtures/caller_at_exit.rb:2:in `block in /spec/ruby/core/kernel/fixtures/caller_at_exit.rb'\n"] == ["/spec/ruby/core/kernel/fixtures/caller_at_exit.rb:6:in `foo'\n", "/spec/ruby/core/kernel/fixtures/caller_at_exit.rb:2:in `block in <main>'\n"] to be truthy but was false
This fixes one spec on Darwin: Signal.list redefines CLD with CHLD if defined FAILED Expected nil == 20 to be truthy but was false
This expands our exception translation to work for more than just the IOException family of types, first including the NotYetConnectedException that does not live within that hierarchy. In addition, it makes this translation method explicitly from Throwable to Throwable with a user-provided fallback, and adds a method for doing this translation or throwing the original error in one shot. This change was motivated by issues in BasicSocket where the NotYetConnectedException was bubbling out as-is, rather than being translated into an ENOTCONN. A subsequent change will modify RubyBasicSocket to use this new logic.
Without this change, we were raising the original NotYetConnected exception instead of a more appropriate ENOTCONN.
When the socket is a datagram socket, implement these using DatagramChannel.send and receive. Otherwise fall back on the previous logic that does writes and reads. This fixes all failures in BasicSocket's read_nonblock specs.
This fixes at least one spec failure on Darwin, and may fix others.
Apparently Travis does not have IPv6, so IPv6-specific specs do not run there.
MacOS appears to provide a hostname for the broadcast address, so when we attempt to reverse the address we get the name instead of the address. We shouldn't reverse the name, but there doesn't appear to be another way to get the hostname from Java's InetAddress.
* On Linux, read_nonblock's use of recv(... MSG_DONTWAIT) does not leave the socket non-blocking, so we emulate that with Java APIs here. * Refactor handling of EAGAIN result to share code with recv_nonblock.
This moves some hanging specs to a new "hangs" tag, to make that exclusion clearer and filterable when updating "fails" tags.
These represent minor behavioral differences when running on Travis CI, but should otherwise pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This started out as a PR to get :fast specs passing on Darwin, but has expanded into fixing a few additional issues.
The bulk of the failing specs were from socket specs, mostly because there are special carve-outs for certain platforms and we did not have these tagged. Where possible, I've actually fixed the related specs on all platforms.
One failure was due to the JIT not using
<main>for the method name of blocks at the root level of a script.One failure was due to incorrectly managing the SIGCLD and SIGCHLD signals the way CRuby does.