Skip Menu |

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

Report information
The Basics
Id: 105125
Status: resolved
Priority: 0/
Queue: Test-Trap

People
Owner: ebhanssen [...] allverden.no
Requestors: Alexander.Brett [...] Sophos.com
SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • v0.2.5
  • v0.2.5.0_1
  • v0.2.5.0_2
  • v0.3.0
  • v0.3.0.0_1
  • v0.3.1
  • v0.3.2
Fixed in: v0.3.3



Subject: 03-files.t broken from v0.2.5 onwards in ActivePerl
Date: Tue, 9 Jun 2015 13:12:03 +0000
To: "bug-Test-Trap [...] rt.cpan.org" <bug-Test-Trap [...] rt.cpan.org>
From: Alexander Brett <Alexander.Brett [...] Sophos.com>
<code> t\03-files-perlio.t ............... ok # Failed test 'Errno-unsetting trap unsets extended OS error (it's not localized)' # at t/03-files.pl line 216. # got: 'The handle is invalid' # expected: '' # Looks like you failed 1 test of 93. t\03-files-systemsafe-preserve.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/93 subtests # Failed test 'Errno-unsetting trap unsets extended OS error (it's not localized)' # at t/03-files.pl line 216. # got: 'The handle is invalid' # expected: '' # Looks like you failed 1 test of 93. t\03-files-systemsafe.t ........... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/93 subtests # Failed test 'Errno-unsetting trap unsets extended OS error (it's not localized)' # at t/03-files.pl line 216. # got: 'The handle is invalid' # expected: '' # Looks like you failed 1 test of 93. t\03-files-tempfile-preserve.t .... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/93 subtests # Failed test 'Errno-unsetting trap unsets extended OS error (it's not localized)' # at t/03-files.pl line 216. # got: 'The handle is invalid' # expected: '' # Looks like you failed 1 test of 93. t\03-files-tempfile.t ............. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/93 subtests </code> Activestate Perl 5.18.4 Win32-x64 Test::Trap 0.3.2 I have also submitted a test report. Show quoted text
________________________________ Sophos Ltd, a company registered in England and Wales, number 2096520, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom
Subject: Re: [rt.cpan.org #105125] 03-files.t broken from v0.2.5 onwards in ActivePerl
Date: Tue, 9 Jun 2015 19:41:01 +0200
To: bug-Test-Trap [...] rt.cpan.org
From: The Sidhekin <sidhekin [...] gmail.com>
On Tue, Jun 9, 2015 at 3:12 PM, Alexander Brett via RT < bug-Test-Trap@rt.cpan.org> wrote: Show quoted text
> > Activestate Perl 5.18.4 > Win32-x64 > Test::Trap 0.3.2 > > I have also submitted a test report.
I guess that on is in the queue. I see a test report from you, but that's with Strawberry perl 5.20.2 … … which also serves to illustrate what I know about these test failures: They're not specific to Activestate nor perl version, but seem to be specific to certain machines, whichever perl they're using. I don't have one of those machines – I've never been able to reproduce this failure. I'm occasionally pondering the failures, but I don't know where to start digging. I'm just waiting for a flash of inspiration or some new info to drop. Aside – that test report of yours (with Strawberry) contained the following: ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: No requirements found … what's up with that? It obviously has installed the dependencies … Eirik
Hmm … looks like email from my gmail account didn't make it in? Or am I just too impatient? Well, lest I forget, here is what I sent from gmail: On Tue, Jun 9, 2015 at 3:12 PM, Alexander Brett via RT <bug-Test-Trap@rt.cpan.org> wrote: Activestate Perl 5.18.4 Win32-x64 Test::Trap 0.3.2 I have also submitted a test report. I guess that on is in the queue. I see a test report from you, but that's with Strawberry perl 5.20.2 … … which also serves to illustrate what I know about these test failures: They're not specific to Activestate nor perl version, but seem to be specific to certain machines, whichever perl they're using. I don't have one of those machines – I've never been able to reproduce this failure. I'm occasionally pondering the failures, but I don't know where to start digging. I'm just waiting for a flash of inspiration or some new info to drop. Aside – that test report of yours (with Strawberry) contained the following: ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: No requirements found … what's up with that? It obviously has installed the dependencies … -- Eirik Berg Hanssen, ebhanssen@cpan.org Just this .sig then nothing more
Subject: RE: [rt.cpan.org #105125] 03-files.t broken from v0.2.5 onwards in ActivePerl
Date: Wed, 10 Jun 2015 04:59:30 +0000
To: "bug-Test-Trap [...] rt.cpan.org" <bug-Test-Trap [...] rt.cpan.org>
From: Alexander Brett <Alexander.Brett [...] Sophos.com>
Hiya, Actually, the Test::Trap Testers page hasn't updated yet - my report isn't on there yet. You'll be able to tell when it is because it'll have activeperl 5.18.4 :) A Show quoted text
-----Original Message----- From: The Sidhekin via RT [mailto:bug-Test-Trap@rt.cpan.org] Sent: 09 June 2015 23:19 To: Alexander Brett Subject: Re: [rt.cpan.org #105125] 03-files.t broken from v0.2.5 onwards in ActivePerl <URL: https://rt.cpan.org/Ticket/Display.html?id=105125 > On Tue, Jun 9, 2015 at 3:12 PM, Alexander Brett via RT < bug-Test-Trap@rt.cpan.org> wrote:
> > Activestate Perl 5.18.4 > Win32-x64 > Test::Trap 0.3.2 > > I have also submitted a test report.
I guess that on is in the queue. I see a test report from you, but that's with Strawberry perl 5.20.2 … … which also serves to illustrate what I know about these test failures: They're not specific to Activestate nor perl version, but seem to be specific to certain machines, whichever perl they're using. I don't have one of those machines – I've never been able to reproduce this failure. I'm occasionally pondering the failures, but I don't know where to start digging. I'm just waiting for a flash of inspiration or some new info to drop. Aside – that test report of yours (with Strawberry) contained the following: ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: No requirements found … what's up with that? It obviously has installed the dependencies … Eirik
________________________________ Sophos Ltd, a company registered in England and Wales, number 2096520, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom
Subject: Re: [rt.cpan.org #105125] 03-files.t broken from v0.2.5 onwards in ActivePerl
Date: Wed, 10 Jun 2015 13:19:46 +0200
To: bug-Test-Trap [...] rt.cpan.org
From: The Sidhekin <sidhekin [...] gmail.com>
On Wed, Jun 10, 2015 at 6:59 AM, Alexander Brett via RT < bug-Test-Trap@rt.cpan.org> wrote: Show quoted text
> > Hiya, > > Actually, the Test::Trap Testers page hasn't updated yet - my report isn't > on there yet. You'll be able to tell when it is because it'll have > activeperl 5.18.4 :)
Yes, I see it now: http://www.cpantesters.org/cpan/report/45cd5879-6c26-1014-a9c5-0ddc0240d5c2 It has the same disappointing section: ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: No requirements found … and it also, obviously, has the dependencies installed. Is this some known problem with App::cpanminus::reporter? :-\ Could you check the version of File::Temp, on both perl installations? I'm not sure it's related, but both of your reports also have a series of warnings from File::Temp – warnings that I'm certainly not seeing on Linux, and that I don't recall seeing on Windows. I'll check when next I'm on Windows, but it might be useful to know what versions of File::Temp are involved. (Indeed, it might be useful to know the versions of all the dependencies, but that's too much to ask you to check manually. If you could get the reporter to include it though …) Eirik
Subject: RE: [rt.cpan.org #105125] 03-files.t broken from v0.2.5 onwards in ActivePerl
Date: Wed, 10 Jun 2015 13:16:18 +0000
To: "bug-Test-Trap [...] rt.cpan.org" <bug-Test-Trap [...] rt.cpan.org>
From: Alexander Brett <Alexander.Brett [...] Sophos.com>
Hi there, Really strange that it's got mangled somewhere; I've done some testing on my computer, and cpanm-reporter creates an accurate Test::Reporter - the relevant section is below. If you want the full thing, I can provide that too? Cheers, A ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: runtime: Module Need Have ------------- ------ -------- base 0 2.18 Carp 0 1.3301 constant 0 1.27 Data::Dump 0 1.22 Exporter 0 5.70 File::Temp 0 0.2304 IO::Handle 0 1.34 lib 0 0.63 perl v5.6.2 5.018004 strict 0 1.07 Test::Builder 0 1.001014 Test::More 0 1.001014 Test::Tester 0.107 0.114 version 0 0.9908 warnings 0 1.18 configure: Module Need Have ------------- ------ -------- Module::Build 0 0.4212 Show quoted text
-----Original Message----- From: The Sidhekin via RT [mailto:bug-Test-Trap@rt.cpan.org] Sent: 10 June 2015 16:50 To: Alexander Brett Subject: Re: [rt.cpan.org #105125] 03-files.t broken from v0.2.5 onwards in ActivePerl <URL: https://rt.cpan.org/Ticket/Display.html?id=105125 > On Wed, Jun 10, 2015 at 6:59 AM, Alexander Brett via RT < bug-Test-Trap@rt.cpan.org> wrote:
> > Hiya, > > Actually, the Test::Trap Testers page hasn't updated yet - my report > isn't on there yet. You'll be able to tell when it is because it'll > have activeperl 5.18.4 :)
Yes, I see it now: http://www.cpantesters.org/cpan/report/45cd5879-6c26-1014-a9c5-0ddc0240d5c2 It has the same disappointing section: ------------------------------ PREREQUISITES ------------------------------ Prerequisite modules loaded: No requirements found … and it also, obviously, has the dependencies installed. Is this some known problem with App::cpanminus::reporter? :-\ Could you check the version of File::Temp, on both perl installations? I'm not sure it's related, but both of your reports also have a series of warnings from File::Temp – warnings that I'm certainly not seeing on Linux, and that I don't recall seeing on Windows. I'll check when next I'm on Windows, but it might be useful to know what versions of File::Temp are involved. (Indeed, it might be useful to know the versions of all the dependencies, but that's too much to ask you to check manually. If you could get the reporter to include it though …) Eirik
________________________________ Sophos Ltd, a company registered in England and Wales, number 2096520, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom
Seeing the same error on my machine, Please inform if there is anyway I can help in debug, configuration is as follows D:\gitspace\CPAN\Verilog-VCD-Writer>uname -a MSYS_NT-6.3 asus 2.4.0(0.292/5/3) 2016-01-07 19:39 x86_64 Msys D:\gitspace\CPAN\Verilog-VCD-Writer>perl -v This is perl 5, version 24, subversion 0 (v5.24.0) built for MSWin32-x64-multi-thread Building and testing Test-Trap-v0.3.2 ... FAIL ! Installing Test::Trap failed. See C:\BERRYB~1\524~1.0_6\data\.cpanm\work\1494968769.12260\build.log for details. Retry with --force to force install it. ************ Error message ********************** # Failed test 'Errno-unsetting trap unsets extended OS error (it's not localized)' # at t/03-files.pl line 216. # got: 'The system could not find the environment option that was entered' # expected: '' # Looks like you failed 1 test of 93. Regards Vijay On Tue Jun 09 13:48:34 2015, sidhekin@gmail.com wrote: Show quoted text
> On Tue, Jun 9, 2015 at 3:12 PM, Alexander Brett via RT < > bug-Test-Trap@rt.cpan.org> wrote: >
> > > > Activestate Perl 5.18.4 > > Win32-x64 > > Test::Trap 0.3.2 > > > > I have also submitted a test report.
> > > I guess that on is in the queue. I see a test report from you, but > that's with Strawberry perl 5.20.2 … > > … which also serves to illustrate what I know about these test failures: > They're not specific to Activestate nor perl version, but seem to be > specific to certain machines, whichever perl they're using. > > I don't have one of those machines – I've never been able to reproduce > this failure. I'm occasionally pondering the failures, but I don't know > where to start digging. I'm just waiting for a flash of inspiration or > some new info to drop. > > Aside – that test report of yours (with Strawberry) contained the > following: > > ------------------------------ > PREREQUISITES > ------------------------------ > > Prerequisite modules loaded: > > No requirements found > > > … what's up with that? It obviously has installed the dependencies … > > > Eirik
Subject: build.log
Download build.log
application/octet-stream 6.6k

Message body not shown because it is not plain text.

Le Mer 17 Mai 2017 05:56:40, JVS a écrit : Show quoted text
> Seeing the same error on my machine, Please inform if there is anyway > I can help in debug, configuration is as follows > > D:\gitspace\CPAN\Verilog-VCD-Writer>uname -a > MSYS_NT-6.3 asus 2.4.0(0.292/5/3) 2016-01-07 19:39 x86_64 Msys > > D:\gitspace\CPAN\Verilog-VCD-Writer>perl -v > > This is perl 5, version 24, subversion 0 (v5.24.0) built for MSWin32- > x64-multi-thread > > > Building and testing Test-Trap-v0.3.2 ... FAIL > ! Installing Test::Trap failed. See > C:\BERRYB~1\524~1.0_6\data\.cpanm\work\1494968769.12260\build.log for > details. Retry with --force to force install it. > > ************ Error message ********************** > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > not localized)' > # at t/03-files.pl line 216. > # got: 'The system could not find the environment option that > was entered' > # expected: '' > # Looks like you failed 1 test of 93. > > Regards > Vijay
I have the same problem on my French Windows 7 (x64), Strawberry Perl 5.26 Building and testing Test-Trap-v0.3.2 Building Test-Trap # Testing Test::Trap 0.3.2, Perl 5.026000, C:\Strawberry\perl\bin\perl.exe t\00-load.t ....................... ok t\01-basic.t ...................... ok t\02-reentrant.t .................. ok # Failed test 'Errno-unsetting trap unsets extended OS error (it's not localized)' # at t/03-files.pl line 216. # got: 'Le système n’a pas trouvé l’option d’environnement spécifiée' # expected: '' # Looks like you failed 1 test of 93. Microsoft Windows [version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Tous droits réservés. C:\>perl -v This is perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32-x64-multi-thread
On 2015-06-09 09:12:17, Alexander.Brett@Sophos.com wrote: Show quoted text
> <code> > t\03-files-perlio.t ............... ok > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > not localized)' > # at t/03-files.pl line 216. > # got: 'The handle is invalid' > # expected: '' > # Looks like you failed 1 test of 93. > t\03-files-systemsafe-preserve.t .. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/93 subtests > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > not localized)' > # at t/03-files.pl line 216. > # got: 'The handle is invalid' > # expected: '' > # Looks like you failed 1 test of 93. > t\03-files-systemsafe.t ........... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/93 subtests > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > not localized)' > # at t/03-files.pl line 216. > # got: 'The handle is invalid' > # expected: '' > # Looks like you failed 1 test of 93. > t\03-files-tempfile-preserve.t .... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/93 subtests > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > not localized)' > # at t/03-files.pl line 216. > # got: 'The handle is invalid' > # expected: '' > # Looks like you failed 1 test of 93. > t\03-files-tempfile.t ............. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/93 subtests > </code> > > Activestate Perl 5.18.4 > Win32-x64 > Test::Trap 0.3.2 > > I have also submitted a test report. > > ________________________________ > > Sophos Ltd, a company registered in England and Wales, number 2096520, > The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United > Kingdom
The same error can be reproduced now on appveyor. See https://ci.appveyor.com/project/eserte/sandbox/build/1.0.52
RT-Send-CC: sidhekin [...] gmail.com, klaus03 [...] gmail.com, exodist [...] cpan.org
On 2017-07-20 03:31:17, SREZIC wrote: Show quoted text
> On 2015-06-09 09:12:17, Alexander.Brett@Sophos.com wrote:
> > <code> > > t\03-files-perlio.t ............... ok > > > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > > not localized)' > > # at t/03-files.pl line 216. > > # got: 'The handle is invalid' > > # expected: '' > > # Looks like you failed 1 test of 93. > > t\03-files-systemsafe-preserve.t .. > > Dubious, test returned 1 (wstat 256, 0x100) > > Failed 1/93 subtests > > > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > > not localized)' > > # at t/03-files.pl line 216. > > # got: 'The handle is invalid' > > # expected: '' > > # Looks like you failed 1 test of 93. > > t\03-files-systemsafe.t ........... > > Dubious, test returned 1 (wstat 256, 0x100) > > Failed 1/93 subtests > > > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > > not localized)' > > # at t/03-files.pl line 216. > > # got: 'The handle is invalid' > > # expected: '' > > # Looks like you failed 1 test of 93. > > t\03-files-tempfile-preserve.t .... > > Dubious, test returned 1 (wstat 256, 0x100) > > Failed 1/93 subtests > > > > # Failed test 'Errno-unsetting trap unsets extended OS error (it's > > not localized)' > > # at t/03-files.pl line 216. > > # got: 'The handle is invalid' > > # expected: '' > > # Looks like you failed 1 test of 93. > > t\03-files-tempfile.t ............. > > Dubious, test returned 1 (wstat 256, 0x100) > > Failed 1/93 subtests > > </code> > > > > Activestate Perl 5.18.4 > > Win32-x64 > > Test::Trap 0.3.2 > > > > I have also submitted a test report. > > > > ________________________________ > > > > Sophos Ltd, a company registered in England and Wales, number 2096520, > > The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United > > Kingdom
> > The same error can be reproduced now on appveyor. See > https://ci.appveyor.com/project/eserte/sandbox/build/1.0.52
OK, I think I found the problem. It can easily be reproduced on a Windows system with modern Test::More: C:\>perl -MTest::More=no_plan -e "$^E=''; is 1, 1; is $^E, ''" ok 1 not ok 2 # Failed test at -e line 1. # got: 'The system could not find the environment option that was entered' # expected: '' 1..2 # Looks like you failed 1 test of 2. Removing the "is 1, 1" statement makes the test pass. My guess is that Test::More functions like is() etc. are accessing non-existent environment variables, and this sets $^E. Like this: C:\>perl -e "$^E=''; $ENV{FOOBARBLA}; warn $^E" The system could not find the environment option that was entered at -e line 1. So the Test::Trap tests pass if the last lines in t/03-files.pl make sure that $^E is not clobbered --- e.g. by moving the $^E test right after calling the trap{} block, or by saving early the value of $^E: trap { $! = 0; $^E = ''; }; my $oserr = $^E; # Test::More::is() may clobber the value ... is $oserr, '', "Errno-unsetting trap unsets extended OS error (it's not localized)"; Or the fix could happen in Test::More, e.g. by localizing $^E in every Test::More function.
$?, $@, and $! are localized for most Test::Builder operations, as well as for all Test2::Context operations, it would be fairly trivial I think to add $^E localizing in Test2. I will add a Test2 ticket. On Thu Aug 03 13:09:55 2017, SREZIC wrote: Show quoted text
> On 2017-07-20 03:31:17, SREZIC wrote:
> > On 2015-06-09 09:12:17, Alexander.Brett@Sophos.com wrote:
> > > <code> > > > t\03-files-perlio.t ............... ok > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > (it's > > > not localized)' > > > # at t/03-files.pl line 216. > > > # got: 'The handle is invalid' > > > # expected: '' > > > # Looks like you failed 1 test of 93. > > > t\03-files-systemsafe-preserve.t .. > > > Dubious, test returned 1 (wstat 256, 0x100) > > > Failed 1/93 subtests > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > (it's > > > not localized)' > > > # at t/03-files.pl line 216. > > > # got: 'The handle is invalid' > > > # expected: '' > > > # Looks like you failed 1 test of 93. > > > t\03-files-systemsafe.t ........... > > > Dubious, test returned 1 (wstat 256, 0x100) > > > Failed 1/93 subtests > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > (it's > > > not localized)' > > > # at t/03-files.pl line 216. > > > # got: 'The handle is invalid' > > > # expected: '' > > > # Looks like you failed 1 test of 93. > > > t\03-files-tempfile-preserve.t .... > > > Dubious, test returned 1 (wstat 256, 0x100) > > > Failed 1/93 subtests > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > (it's > > > not localized)' > > > # at t/03-files.pl line 216. > > > # got: 'The handle is invalid' > > > # expected: '' > > > # Looks like you failed 1 test of 93. > > > t\03-files-tempfile.t ............. > > > Dubious, test returned 1 (wstat 256, 0x100) > > > Failed 1/93 subtests > > > </code> > > > > > > Activestate Perl 5.18.4 > > > Win32-x64 > > > Test::Trap 0.3.2 > > > > > > I have also submitted a test report. > > > > > > ________________________________ > > > > > > Sophos Ltd, a company registered in England and Wales, number > > > 2096520, > > > The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United > > > Kingdom
> > > > The same error can be reproduced now on appveyor. See > > https://ci.appveyor.com/project/eserte/sandbox/build/1.0.52
> > OK, I think I found the problem. It can easily be reproduced on a > Windows system with modern Test::More: > > C:\>perl -MTest::More=no_plan -e "$^E=''; is 1, 1; is $^E, ''" > ok > 1 > not > ok 2 > # Failed test at -e > line 1. > # got: 'The system could not find the environment option that > was entered' > # > expected: '' > 1..2 > # Looks like you failed 1 > test of 2. > > Removing the "is 1, 1" statement makes the test pass. > > My guess is that Test::More functions like is() etc. are accessing > non-existent environment variables, and this sets $^E. Like this: > > C:\>perl -e "$^E=''; $ENV{FOOBARBLA}; warn $^E" > The system could not find the environment option that was entered at > -e line 1. > > So the Test::Trap tests pass if the last lines in t/03-files.pl make > sure that $^E is not clobbered --- e.g. by moving the $^E test right > after calling the trap{} block, or by saving early the value of $^E: > > trap { > $! = 0; > $^E = ''; > }; > my $oserr = $^E; # Test::More::is() may clobber the value > ... > is $oserr, '', "Errno-unsetting trap unsets extended OS error > (it's not localized)"; > > > Or the fix could happen in Test::More, e.g. by localizing $^E in every > Test::More function.
RT-Send-CC: klaus03 [...] gmail.com, exodist [...] cpan.org, sidhekin [...] gmail.com
The problem seems to happen in write() within Test2::Formatter::TAP. Two environment variables are checked here: HARNESS_ACTIVE and HARNESS_IS_VERBOSE. The former is usually set when running "make test", so a workaround for the problem is simply to type SET HARNESS_IS_VERBOSE=0 before building the module. On 2017-08-03 16:19:41, EXODIST wrote: Show quoted text
> $?, $@, and $! are localized for most Test::Builder operations, as > well as for all Test2::Context operations, it would be fairly trivial > I think to add $^E localizing in Test2. I will add a Test2 ticket. > > > On Thu Aug 03 13:09:55 2017, SREZIC wrote:
> > On 2017-07-20 03:31:17, SREZIC wrote:
> > > On 2015-06-09 09:12:17, Alexander.Brett@Sophos.com wrote:
> > > > <code> > > > > t\03-files-perlio.t ............... ok > > > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > > (it's > > > > not localized)' > > > > # at t/03-files.pl line 216. > > > > # got: 'The handle is invalid' > > > > # expected: '' > > > > # Looks like you failed 1 test of 93. > > > > t\03-files-systemsafe-preserve.t .. > > > > Dubious, test returned 1 (wstat 256, 0x100) > > > > Failed 1/93 subtests > > > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > > (it's > > > > not localized)' > > > > # at t/03-files.pl line 216. > > > > # got: 'The handle is invalid' > > > > # expected: '' > > > > # Looks like you failed 1 test of 93. > > > > t\03-files-systemsafe.t ........... > > > > Dubious, test returned 1 (wstat 256, 0x100) > > > > Failed 1/93 subtests > > > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > > (it's > > > > not localized)' > > > > # at t/03-files.pl line 216. > > > > # got: 'The handle is invalid' > > > > # expected: '' > > > > # Looks like you failed 1 test of 93. > > > > t\03-files-tempfile-preserve.t .... > > > > Dubious, test returned 1 (wstat 256, 0x100) > > > > Failed 1/93 subtests > > > > > > > > # Failed test 'Errno-unsetting trap unsets extended OS error > > > > (it's > > > > not localized)' > > > > # at t/03-files.pl line 216. > > > > # got: 'The handle is invalid' > > > > # expected: '' > > > > # Looks like you failed 1 test of 93. > > > > t\03-files-tempfile.t ............. > > > > Dubious, test returned 1 (wstat 256, 0x100) > > > > Failed 1/93 subtests > > > > </code> > > > > > > > > Activestate Perl 5.18.4 > > > > Win32-x64 > > > > Test::Trap 0.3.2 > > > > > > > > I have also submitted a test report. > > > > > > > > ________________________________ > > > > > > > > Sophos Ltd, a company registered in England and Wales, number > > > > 2096520, > > > > The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United > > > > Kingdom
> > > > > > The same error can be reproduced now on appveyor. See > > > https://ci.appveyor.com/project/eserte/sandbox/build/1.0.52
> > > > OK, I think I found the problem. It can easily be reproduced on a > > Windows system with modern Test::More: > > > > C:\>perl -MTest::More=no_plan -e "$^E=''; is 1, 1; is $^E, ''" > > ok > > 1 > > not > > ok 2 > > # Failed test at -e > > line 1. > > # got: 'The system could not find the environment option > > that > > was entered' > > # > > expected: '' > > 1..2 > > # Looks like you failed 1 > > test of 2. > > > > Removing the "is 1, 1" statement makes the test pass. > > > > My guess is that Test::More functions like is() etc. are accessing > > non-existent environment variables, and this sets $^E. Like this: > > > > C:\>perl -e "$^E=''; $ENV{FOOBARBLA}; warn $^E" > > The system could not find the environment option that was entered at > > -e line 1. > > > > So the Test::Trap tests pass if the last lines in t/03-files.pl make > > sure that $^E is not clobbered --- e.g. by moving the $^E test right > > after calling the trap{} block, or by saving early the value of $^E: > > > > trap { > > $! = 0; > > $^E = ''; > > }; > > my $oserr = $^E; # Test::More::is() may clobber the value > > ... > > is $oserr, '', "Errno-unsetting trap unsets extended OS error > > (it's not localized)"; > > > > > > Or the fix could happen in Test::More, e.g. by localizing $^E in > > every > > Test::More function.
On 2017-08-03 22:09:55, SREZIC wrote: Show quoted text
> OK, I think I found the problem. It can easily be reproduced on a > Windows system with modern Test::More:
Thank you so much. I had about given up on reproducing, understanding or fixing this one. And an extra thank you for noting that it's HARNESS_IS_VERBOSE: When I finally did reproduce it, I was about to go nuts again, seeing C<< cpan . >> failures while C<< prove -lv >> succeeded. ;-) I've fixed the failing tests and similar ones (that I imagine might wind up failing the same way) by testing a copy of $^E, taken before Test::More gets a chance to clobber it. I might cut a release with that, but I imagine this kind of thing could show up in the test methods as well, so I might look into that first. I'll sleep on it; it's certainly late enough.
I've release v0.3.3. CPAN testers are green; though there's been just one report from mswin32 as yet, it seems I didn't break anything; and since my reproducing system is happy with v0.3.3, I figure this is resolved, at least until I hear differently. Thank you!