Mark Jason Dominus wrote:
TF1127682.TXT;193
TF1152675.TXT;183
TF1211585.TXT;188
TF1211585.TXT;187
...
TF1211585.TXT;1
that are not being deleted properly. The file which was created 188 times
contains just the strings:
These are generated by some of the longer-running Tie::File tests.
The tests all have the correct C<1 while unlink "tf$$.txt> in the
END block, so it's a bit mysterious why they don't get clobbered.
It seems the END block is quitting prematurely for some reason.
I can't think of any way for me to investigate this, but if there's
anything I can do to assist, please let me know.
Well, I think I found the cure, or at least a symptom eradicator.
Several of the tests (3, to be exact) set an alarm but never turn it
off. By the time the SIGALRM gets delivered, the local handler has gone
out of scope. I'm not enough of a signal guru to know what exactly is
supposed to happen in that case, but apparently nothing happens until
the END block kicks in. And I don't know why the END block would allow
delivery of a previously blocked or ignored signal, but it does. At
least that's my conclusion from the fact that setting alarm(0) cures the
problem of leftover files.
This only showed up on VMS because of the versioning file system; some
of the Tie::File tests create hundreds or even thousands of versions of
the same file, and it takes a while to delete them all, long enough for
the END block to get interrupted in mid-stream. The attached patch turns
off the alarms when the tests are done with them. It only made a
reproducible difference in the case of 29_downcopy.t, but I turned them
all off just to be sure.
--- lib/Tie/File/t/24_cache_loop.t;-0 Fri Jul 19 18:49:26 2002
+++ lib/Tie/File/t/24_cache_loop.t Tue Aug 12 19:42:39 2003
@@ -43,6 +43,7 @@
alarm 5 unless $^P;
@a = "record0" .. "record9";
print "ok 3\n";
+alarm 0;
END {
undef $o;
--- lib/Tie/File/t/29a_upcopy.t;-0 Tue May 13 14:09:06 2003
+++ lib/Tie/File/t/29a_upcopy.t Tue Aug 12 19:43:11 2003
@@ -129,7 +129,7 @@
local $SIG{ALRM} = sub { die "Alarm clock" };
my $a_retval = eval { alarm(5) unless $^P; $o->_upcopy($src, $dst, $len) };
my $err = $@;
- undef $o; untie @lines;
+ undef $o; untie @lines; alarm(0);
if ($err) {
if ($err =~ /^Alarm clock/) {
print "# Timeout\n";
--- lib/Tie/File/t/29_downcopy.t;-0 Thu Jun 19 01:43:04 2003
+++ lib/Tie/File/t/29_downcopy.t Tue Aug 12 19:38:29 2003
@@ -273,7 +273,7 @@
local $SIG{ALRM} = sub { die "Alarm clock" };
my $a_retval = eval { alarm(5) unless $^P; $o->_downcopy($newdata, $pos, $len) };
my $err = $@;
- undef $o; untie @lines;
+ undef $o; untie @lines; alarm(0);
if ($err) {
if ($err =~ /^Alarm clock/) {
print "# Timeout\n";