Skip to content

Commit

Permalink
Re-try deleting working files in is_run
Browse files Browse the repository at this point in the history
It appears on Windows, when the `is_run` code launches it's own Proc
that does STDIN things, there's some delay before `.in` file can
be deleted by `is_run` so if we detect failurage to delete a working
file, before dying, sleep a bit and retry and only if we fail then,
then die.
  • Loading branch information
zoffixznet committed May 20, 2017
1 parent c1d6211 commit 6bad631
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/Test/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ sub get_out( Str $code, Str $input?, :@args, :@compiler-args) is export {
}

# Try to delete all the temp files written. If any survive, die.
my @files = map { "$fnbase.$_" }, <code in out err>;
my @files = map { "$fnbase.$_".IO }, <code in out err>;
for @files -> $f {
try unlink $f;
if $f.IO ~~ :e {
die "Can't unlink '$f'";
unlink $f;
if $f.e {
sleep 3;
$f.unlink or die "Can't unlink '$f': $!";
}
}

Expand Down

0 comments on commit 6bad631

Please sign in to comment.