diff options
author | David Mitchell <davem@iabyn.com> | 2013-06-05 11:54:36 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-06-05 11:54:36 +0100 |
commit | c106f444cf492294557fcc9edf1b42782dd07ade (patch) | |
tree | 4c9b8bea171eaeba886e8bb8cde4698316932f64 /t/comp | |
parent | 4bc5302aa9ad04cec6442e472dc1d313187dee04 (diff) | |
download | perl-c106f444cf492294557fcc9edf1b42782dd07ade.tar.gz |
require.t: handle parallel runs
There are random smoke failures in this test script, which are consistent
with multiple processes running the same test script in parallel, and
writing/unlinking the same (hard-coded) temp files.
As a temp hack, add a sleep(20) if this looks like its happening,
and see if the smoke issues go away.
Diffstat (limited to 't/comp')
-rw-r--r-- | t/comp/require.t | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/t/comp/require.t b/t/comp/require.t index cdf19fb63b..ac711321be 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -16,9 +16,21 @@ sub do_require { # don't make this lexical $i = 1; -my @fjles_to_delete = qw (bleah.pm bleah.do bleah.flg urkkk.pm urkkk.pmc +my @files_to_delete = qw (bleah.pm bleah.do bleah.flg urkkk.pm urkkk.pmc krunch.pm krunch.pmc whap.pm whap.pmc); +# there may be another copy of this test script running, or the files may +# just not have been deleted at the end of the last run; if the former, we +# wait a while so that creating and unlinking these files won't interfere +# with the other process; if the latter, then the delay is harmless. As +# to why there might be multiple execution of this test file, I don't +# know; but this is an experiment to see if random smoke failures go away. + +if (grep -e, @files_to_delete) { + print "# Sleeping for 20 secs waiting for other process to finish\n"; + sleep 20; +} + my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/; @@ -330,7 +342,7 @@ foreach (sort keys %templates) { } END { - foreach my $file (@fjles_to_delete) { + foreach my $file (@files_to_delete) { 1 while unlink $file; } } |