Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Fixes INT signal for ruby executables #4727

Merged
merged 7 commits into from
Jun 28, 2016

Conversation

asutoshpalai
Copy link
Contributor

Fixes #4568

@@ -60,6 +60,7 @@ def kernel_load(file, *args)
ui = Bundler.ui
Bundler.ui = nil
require "bundler/setup"
Signal.list.each {|signal| trap(signal, "DEFAULT") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signal.list is a hash, so could that be |signal, _|?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea! My bad!

@asutoshpalai
Copy link
Contributor Author

Is it fine to include the spec file in exempt list of quality_spec for debug mechanism?
The sleep is firing it off.

The alternative to sleep is an infinite loop with the risk that if the specs fail we will be left with a running ruby process on our computer even after rspec exits.

@segiddins
Copy link
Member

@asutoshpalai apply the following and add the magic comment at the end of the line with the sleep

diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index d5178d7..57e737c 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -28,7 +28,9 @@ describe "The library itself" do

     failing_lines = []
     File.readlines(filename).each_with_index do |line, number|
-      failing_lines << number + 1 if line =~ debugging_mechanisms_regex
+      if line =~ debugging_mechanisms_regex && !line.end_with?("# ignore quality_spec")
+        failing_lines << number + 1
+      end
     end

     return if failing_lines.empty?

@segiddins
Copy link
Member

@asutoshpalai this seems to break some stuff on 1.8.7

@asutoshpalai
Copy link
Contributor Author

The variable arguments to yield are breaking some specs in 1.8.7. Will fix those specs with dummy arguments.

But the major problem is on 1.8.7 popen3 doesn't have any method to obtain the pid, which in turn means we can't send any signal to the process. So the new spec can't work on 1.8.7.

@segiddins
Copy link
Member

that's fine, you can limit the spec to being ruby >= 1.9.3

end
RUBY

it do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec needs a name

@segiddins
Copy link
Member

👍 other than the one comment

@segiddins
Copy link
Member

@homu r+

@homu
Copy link
Contributor

homu commented Jun 28, 2016

📌 Commit 5fcd26d has been approved by segiddins

homu added a commit that referenced this pull request Jun 28, 2016
Fixes INT signal for ruby executables

Fixes #4568
@homu
Copy link
Contributor

homu commented Jun 28, 2016

⌛ Testing commit 5fcd26d with merge 99a9a15...

@homu
Copy link
Contributor

homu commented Jun 28, 2016

☀️ Test successful - status

@homu homu merged commit 5fcd26d into rubygems:master Jun 28, 2016
@asutoshpalai asutoshpalai deleted the exec-signal-fix branch July 2, 2016 07:38
@coilysiren coilysiren modified the milestone: Release Archive Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants