X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F31.with_pid_file_and_poe.t;fp=t%2F31.with_pid_file_and_poe.t;h=ae1c2014781ccbbfb4df9fe44cdd5a987354c582;hb=b38ab84f7a1b83212eefcb2e7f876c42b8dbfb24;hp=740090f1eae4a94f7150fbb61eac4328dab25f0b;hpb=24b6fd77f2d0f29555c753ea2fcc814368068d65;p=gitmo%2FMooseX-Daemonize.git diff --git a/t/31.with_pid_file_and_poe.t b/t/31.with_pid_file_and_poe.t index 740090f..ae1c201 100644 --- a/t/31.with_pid_file_and_poe.t +++ b/t/31.with_pid_file_and_poe.t @@ -25,6 +25,8 @@ my $PIDFILE = catfile($CWD, 'test-app.pid'); $ENV{MX_DAEMON_STDOUT} = catfile($CWD, 'Out.txt'); $ENV{MX_DAEMON_STDERR} = catfile($CWD, 'Err.txt'); +unlink $PIDFILE; # clean up anythinf leftover by last run + { package MyFooDaemon; use Moose; @@ -63,6 +65,7 @@ $ENV{MX_DAEMON_STDERR} = catfile($CWD, 'Err.txt'); }, terminate => sub { my ($kernel, $heap) = @_[KERNEL, HEAP]; + $self->pidfile->remove if $self->pidfile->pid == $$; } }, heap => [ 0 ]