develooper Front page | perl.perl5.porters | Postings from March 2014

Re: Inconsistent cpan/Win32API-File/t/file.t failure (was Re: Smoke[smoke-me/nicholas/openn] v5.19.9-200-g22d0f40 FAIL(F) MSWin32 Win2000 SP4(x86/1 cpu) {smoke-me})

From:
Nicholas Clark
Date:
March 19, 2014 10:42
Subject:
Re: Inconsistent cpan/Win32API-File/t/file.t failure (was Re: Smoke[smoke-me/nicholas/openn] v5.19.9-200-g22d0f40 FAIL(F) MSWin32 Win2000 SP4(x86/1 cpu) {smoke-me})
Message ID:
20140319104243.GA22619@plum.flirble.org
On Wed, Mar 19, 2014 at 11:37:35AM +0100, Christian Walde wrote:
> On Wed, 19 Mar 2014 10:30:57 +0100, Nicholas Clark <nick@ccl4.org> wrote:
> 
> > On Wed, Mar 19, 2014 at 12:50:00AM -0500, George Greer wrote:
> >
> >> [default] -DDEBUGGING -Duseithreads
> >> ../cpan/Win32API-File/t/file.t..............................FAILED
> >>     Non-zero exit status: 13
> >>     Bad plan.  You planned 270 tests but ran 1.
> >
> > That's really strange. 3 out of 4 pass. The other failed like this:
> >
> > Could not rmdir W32ApiF.tmp: Permission denied at t/file.t line 57.
> 
> That looks like a timing issue. Adding `select undef, undef, undef, 0.25;`  
> before the rmdir in question should fix that.

Thanks for the feedback. I'm curious why. The relevant code is:

if(  -d $dir  ) {
    print "# deleting ",File::Spec->catdir($temp,$dir,'*'),"\n" if glob "$dir/*";

    for (glob "$dir/*") {
        chmod 0777, $_;
        unlink $_;
    }
    rmdir $dir or die "Could not rmdir $dir: $!";
}


That code is single-threaded in Perl, isn't it? So what might be holding
"open" the directory, but lets it go within 0.25s.

Nicholas Clark



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About