Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 3767
Status: rejected
Priority: 0/
Queue: Test-Harness

People
Owner: andy [...] hexten.net
Requestors: stas+old [...] stason.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Date: Wed, 10 Sep 2003 22:44:27 -0500
To: bug-test-harness [...] rt.cpan.org
From: Stas Bekman <stas [...] stason.org>(by way of Andy Lester)
Subject: T::H trapping core dumps
Hi Andy, I have a request for a new feature in Test::Harness. I want a new env var which when true will scan the current dir for core files *after each test*. In mod_perl 2.0, we do that before and after the whole harness, but as the number of tests grows it becomes really hard to find the test that caused the core dump. Here is a snippet of code that could be useful: %core_files keeps track of seen core files #e.g. t/core or t/core.12499 my $core_pat = '^core(\.\d+)?' . "\$"; sub scan_core { my ($self, $top_dir) = @_; my $times = 0; finddepth(sub { return unless -f $_; return unless /$core_pat/o; my $core = $File::Find::name; if (exists $core_files{$core} && $core_files{$core} == -M $core) { # we have seen this core file before the start of the test info "an old core file has been found: $core"; } else { my $oh = oh(); my $again = $times++ ? "again" : ""; error "oh $oh, server dumped core $again"; error "for stacktrace, run: gdb $vars->{httpd} -core $core"; } }, $top_dir); } Show quoted text
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Date: Wed, 10 Sep 2003 22:04:21 -0700
From: Michael G Schwern <schwern [...] pobox.com>
To: "stas [...] stason.org via RT" <bug-Test-Harness [...] rt.cpan.org>
CC: "AdminCc of cpan Ticket #3767": ;
Subject: Re: [cpan #3767] T::H trapping core dumps
RT-Send-Cc:
On Wed, Sep 10, 2003 at 11:44:31PM -0400, stas@stason.org via RT wrote: Show quoted text
> I have a request for a new feature in Test::Harness. I want a new env > var which when true will scan the current dir for core files *after > each test*. In mod_perl 2.0, we do that before and after the whole > harness, but as the number of tests grows it becomes really hard to > find the test that caused the core dump.
Wouldn't the test that produced the core be the one that segfaulted? Either way, this strikes me as very, very special case. Also almost impossible to make portable. -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern/ If at first you don't succeed, call in an air strike.
See Schwern's comment.