Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore previous interrupt handler after run #5808

Closed
wants to merge 1 commit into from
Closed

Restore previous interrupt handler after run #5808

wants to merge 1 commit into from

Conversation

deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Apr 22, 2018

I was running puma's test suite, where rubocop is run before the test suite. One of the tests was hanging, and when pressing Ctrl-C to abort it, I would get rubocop's Ctrl-C handler run.

That seemed unexpected, I think rubocop should probably restore the previously installed handler after it's run?


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run rake default or rake parallel. It executes all tests and RuboCop for itself, and generates the documentation.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 23, 2018

Seems like a good change to me, but it requires a changelog entry.

Copy link
Contributor

@rrosenblum rrosenblum left a comment

Choose a reason for hiding this comment

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

The code looks good to me. Is it possible to write a test for this?

@deivid-rodriguez
Copy link
Contributor Author

deivid-rodriguez commented Apr 23, 2018

@bbatsov Changelog entry added!

The code looks good to me. Is it possible to write a test for this?

Of course it is, but I don't really feel very excited about it. If this is not good to go without a test I'll just leave this opened so anyone willing to do it (including future me) can pick it up! :)

@deivid-rodriguez
Copy link
Contributor Author

deivid-rodriguez commented Apr 23, 2018

Actually I'll add that test since this commit is actually breaking the default rubocop handler during rubocop test suite... Calling this WIP.

Not sure when I'll get to it though.

EDIT: Actually no, the behavior is the same as in master. During execution of spec/rubocop/cli_spec.rb, Ctrl-C doesn't seem to work. I'll add the test though.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 29, 2018

OK, ping us when ready.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 5, 2018

@deivid-rodriguez ping :-)

@deivid-rodriguez
Copy link
Contributor Author

Hei @bbatsov, I don't think I'll get to this any time soon. I'll close this and reopen when I get time to complete it! :)

@deivid-rodriguez deivid-rodriguez deleted the restore_previous_interrupt_handler_after_run branch November 10, 2018 12:05
@deivid-rodriguez
Copy link
Contributor Author

deivid-rodriguez commented Nov 10, 2018

Ended up opening some separate PRs with a different approach to fix this, also with some testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants