Git Product home page Git Product logo

proc-guard's Introduction

NAME

Proc::Guard - process runner with RAII pattern

SYNOPSIS

use Test::TCP qw/empty_port wait_port/;
use File::Which qw/which/;
use Proc::Guard;

my $port = empty_port();
my $proc = proc_guard(scalar(which('memcached')), '-p', $port);
wait_port($port);

# your code here

# --------------
# or, use perl code
my $proc = proc_guard(sub {
    ... # run this code in child process
});
...

DESCRIPTION

Proc::Guard runs process, and destroys it when the perl script exits.

This is useful for testing code working with server process.

FUNCTIONS

  • proc_guard(@cmdline|\&code)

    This is shorthand for:

      Proc::Guard->new(
          command => \@cmdline,
      );
    

    or

      Proc::Guard->new(
          code => \&code,
      );
    

METHODS

  • my $proc = Proc::Guard->new(%args);

    Create and run a process. The process is terminated when the returned object is being DESTROYed.

    • command

        Proc::Guard->new(command => '/path/to/memcached');
        # or
        Proc::Guard->new(command => ['/path/to/memcached', '-p', '11211']);
      

      The command line.

    • code

        Proc::Guard->new(code => sub { ... });
      

      'code' or 'command' is required.

    • auto_start

        Proc::Guard->new(auto_start => 0);
      

      Start child process automatically or not(default: 1).

  • pid

    Returns process id (or undef if not running).

  • start

    Starts process.

  • stop

    Stops process.

VARIABLES

  • $Proc::Guard::EXIT_STATUS

    The last exit status code by $proc->stop. If waitpid failed with an error, this will be set to undef.

AUTHOR

Tokuhiro Matsuno

LICENSE

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

proc-guard's People

Contributors

tokuhirom avatar neilb avatar xdg avatar karupanerura avatar

Stargazers

Angus H. avatar lestrrat avatar  avatar Keiji, Yoshimi avatar

Watchers

 avatar James Cloos avatar  avatar

proc-guard's Issues

Fails tests without '.' in @INC

5.25.* with -Ddefault_inc_excludes_dot ( default since 5.25.11 )

PERL_DL_NONLAZY=1 "/home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/bin/perl5.25.10" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/02-client.t line 8.
BEGIN failed--compilation aborted at t/02-client.t line 8.
t/02-client.t ................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/06-response-parser.t .......... ok
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/05-taskset.t line 7.
BEGIN failed--compilation aborted at t/05-taskset.t line 7.
t/05-taskset.t .................. 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/03-worker.t line 10.
BEGIN failed--compilation aborted at t/03-worker.t line 10.
t/03-worker.t ................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/08-jobstatus.t ................ ok
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/13-fail.t line 7.
BEGIN failed--compilation aborted at t/13-fail.t line 7.
t/13-fail.t ..................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/12-sum.t line 10.
BEGIN failed--compilation aborted at t/12-sum.t line 10.
t/12-sum.t ...................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/10-job.t ...................... ok
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/14-sleep.t line 9.
BEGIN failed--compilation aborted at t/14-sleep.t line 9.
t/14-sleep.t .................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/07-response-parser-taskset.t .. ok
t/00-use.t ...................... ok
readline() on unopened filehandle GEN0 at /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib/Gearman/Util.pm line 246.
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/50-wait_timeout.t line 9.
BEGIN failed--compilation aborted at t/50-wait_timeout.t line 9.
t/50-wait_timeout.t ............. 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/17-status.t line 7.
BEGIN failed--compilation aborted at t/17-status.t line 7.
t/17-status.t ................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/15-priority.t line 7.
BEGIN failed--compilation aborted at t/15-priority.t line 7.
t/15-priority.t ................. 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/Worker.pm in @INC (you may need to install the t::Worker module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/18-ssl.t line 6.
BEGIN failed--compilation aborted at t/18-ssl.t line 6.
t/18-ssl.t ...................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/16-background.t line 7.
BEGIN failed--compilation aborted at t/16-background.t line 7.
t/16-background.t ............... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/Server.pm in @INC (you may need to install the t::Server module) (@INC contains: /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/lib /home/kent/.cpanm/work/1490341893.3308/Gearman-2.002.004/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/40-prefix.t line 9.
BEGIN failed--compilation aborted at t/40-prefix.t line 9.
t/40-prefix.t ................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/11-unit.t ..................... ok
t/09-connect.t .................. skipped: without $ENV{AUTHOR_TESTING}
t/01-object.t ................... ok
t/04-task.t ..................... ok
t/65-responseparser.t ........... ok

Test Summary Report
-------------------
t/02-client.t                 (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/05-taskset.t                (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/03-worker.t                 (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/13-fail.t                   (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/12-sum.t                    (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/14-sleep.t                  (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/50-wait_timeout.t           (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/17-status.t                 (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/15-priority.t               (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/18-ssl.t                    (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/16-background.t             (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/40-prefix.t                 (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=22, Tests=241,  4 wallclock secs ( 0.10 usr  0.05 sys +  2.47 cusr  0.48 csys =  3.10 CPU)
Result: FAIL
Failed 12/22 test programs. 0/241 subtests failed.

Stop processes with SIGKILL if SIGTERM is ignored

By default, Proc::Guard will stop processes using SIGTERM [0], which can be handled by the process and thus enables it to clean up after itself. However, as it can be ignored, it would be advisable to wait for some time (30 or 60 seconds is common), check if the process is still running, and follow up with SIGKILL, which will immediately terminate the process in a way that cannot be caught.

[0] https://metacpan.org/source/TOKUHIROM/Proc-Guard-0.07/lib/Proc/Guard.pm#L74

Consider running processes in a new cgroup

Hello,

I haven't tested it, but I believe this module will have difficulty cleaning up processes that double-fork. systemd runs services in their own control group, so when stopping the service, the whole group can be torn down, which cleans up any potentially-orphaned child processes (even if they double-fork).

It might be a good idea to leverage the (Linux-specific) cgroup mechanism if available, or otherwise note (for example, in READMEs) that processes are expected NOT to fork in order to be cleaned up properly.

Jonathan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.