HomePhorge

(#6346) Move the trap calls onto Signal so they're easier to stub
7cb884e44db4Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#6346) Move the trap calls onto Signal so they're easier to stub

Once you stub signal traps in tests, you can hit ctrl+c in the middle of
a spec run and it will stop the run instead of puppet catching the
SIGINT.

I had trouble easily tracking down all the places to stub traps when the
trap was being called as a private method on applications and daemons,
but calling trap on Signal is equivalent since Kernel calls Signal.trap
and Object mixes in Kernel to provide trap as a private method on all
objects.

A bigger solution would be to refactor everywhere we call trap into a
method that's called consistently since right now we sprinkle SIGINT and
SIGTERM trap handling over applications and daemons in inconsistent
ways, returning different error codes and using different messages.
I've captured this info in ticket #6345.

Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>

Details

Provenance
Matt Robinson <matt@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU9b7b0f3ad87a: Merge branch '2.6.x' into 2.6.next
Branches
Unknown
Tags
Unknown

Event Timeline

Matt Robinson <matt@puppetlabs.com> committed rPU7cb884e44db4: (#6346) Move the trap calls onto Signal so they're easier to stub (authored by Matt Robinson <matt@puppetlabs.com>).Feb 17 2011, 12:13 AM