Skip Menu |

Preferred bug tracker

Please email the preferred bug tracker to report your issue.

This queue is for tickets about the Mac-Pasteboard CPAN distribution.

Report information
The Basics
Id: 93358
Status: patched
Priority: 0/
Queue: Mac-Pasteboard

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.006
Fixed in: 0.006_01



Subject: tests fail: temp files being reused
Tests fail when HARNESS_OPTIONS=j9. It looks like you're re-using the same temp files/directories between tests, which is bad when there is more than one test running at once. You should create a new tempdir each time, such as what is provided for you in File::Temp. --> Working on Mac::Pasteboard Fetching http://mirrors.gossamer-threads.com/CPAN/authors/id/W/WY/WYANT/Mac-Pasteboard-0.006.tar.gz -> OK Unpacking Mac-Pasteboard-0.006.tar.gz Entering Mac-Pasteboard-0.006 Checking configure dependencies from META.json Checking if you have Module::Build 0.36 ... Yes (0.4204) Configuring Mac-Pasteboard-0.006 Running Build.PL The pbtool script is a front-end for Mac::Pasteboard, for ad-hoc manipulation of Mac OS X pasteboards. Do you want to install pbtool? [n ]n Created MYMETA.yml and MYMETA.json Creating new 'Build' script for 'Mac-Pasteboard' version '0.006' -> OK Checking dependencies from MYMETA.json ... Checking if you have ExtUtils::CBuilder 0 ... Yes (0.280210) Checking if you have strict 0 ... Yes (1.07) Checking if you have Carp 0 ... Yes (1.29) Checking if you have Encode 0 ... Yes (2.49) Checking if you have warnings 0 ... Yes (1.18) Checking if you have Scalar::Util 1.01 ... Yes (1.35) Checking if you have Test::More 0.88 ... Yes (1.001002) Building and testing Mac-Pasteboard-0.006 Building Mac-Pasteboard Pasteboard.xs -> lib/Mac/Pasteboard.xs constant-c.inc -> lib/Mac/constant-c.inc constant-h.inc -> lib/Mac/constant-h.inc constant-xs.inc -> lib/Mac/constant-xs.inc pbl.c -> lib/Mac/pbl.c pbl.h -> lib/Mac/pbl.h ppport.h -> lib/Mac/ppport.h cc -Ilib/Mac -I/Users/ether/perl5/perlbrew/perls/18.2/lib/5.18.2/darwin-2level/CORE -DTIGER -c -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include -O3 -o lib/Mac/pbl.o lib/Mac/pbl.c cc -Ilib/Mac -I/Users/ether/perl5/perlbrew/perls/18.2/lib/5.18.2/darwin-2level/CORE -DXS_VERSION="0.006" -DVERSION="0.006" -DTIGER -c -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include -O3 -o lib/Mac/Pasteboard.o lib/Mac/Pasteboard.c ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Mac/Pasteboard/Pasteboard.bs') env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector -framework ApplicationServices -o blib/arch/auto/Mac/Pasteboard/Pasteboard.bundle lib/Mac/Pasteboard.o lib/Mac/pbl.o t/error.t .. ok t/basic.t .. ok Pasteboard error -25130 (badPasteboardSyncErr): The pasteboard has been modified and must be synchronized before use at t/misc.t line 27. # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 2 just after 1. t/misc.t ... Dubious, test returned 2 (wstat 512, 0x200) All 1 subtests passed t/paste.t .. ok t/synch.t .. ok # Failed test 'Place text data on the default pasteboard.' # at t/copy.t line 66. # got: '' # expected: 'There was a young lady named Bright' # Failed test 'Flavor com.apple.traditional-mac-plain-text should be present on the default pasteboard' # at t/copy.t line 69. # Looks like you failed 2 tests of 18. t/copy.t ... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/18 subtests Test Summary Report ------------------- t/misc.t (Wstat: 512 Tests: 1 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/copy.t (Wstat: 512 Tests: 18 Failed: 2) Failed tests: 2-3 Non-zero exit status: 2 Files=6, Tests=44, 1 wallclock secs ( 0.05 usr 0.03 sys + 0.48 cusr 0.28 csys = 0.84 CPU) Result: FAIL Failed 2/6 test programs. 2/44 subtests failed.
Thank you very much for your report. The reuse was a misguided attempt to be clever in code that needed to be simple and direct. Can't work on this right away, but it should be days, rather than weeks or months. Feel free to rattle my cage. Tom
I initially accepted your temp file diagnosis because I seem to remember playing games with temp files somewhere along the line. But unless it's deeper than I can see, it's not this distribution. What I think is happening is that the purpose of the module is to modify the clipboard using system services, and the different tests all use the same clipboards. Apple supports multiple clipboards, and even custom and arbitrarily-named ones. But the tests tend to use the Apple-supplied command-line programs 'pbcopy' and 'pbpaste' to make sure my code did the right thing, and these guys do NOT support arbitrary clipboards. Moreover, each test rings the changes on the clipboards that 'pbcopy' and 'pbpaste' DO support. At least sometimes I have been able to identify the source of the faulty data as coming from another of the test files. Yes, this would happen if I were reusing temp files, but reusing system-supplied clipboards would have the same effect, and I don't see any way around using them to test code that modifies clipboards. In short, I am pretty sure that the tests of this module do not use temp files at any level accessible to your suggested File::Temp solution. If you can come up with a patch that demonstrates otherwise, I would certainly give it serious consideration. Failing that, the only thing I can think of to do at the moment is to combine everything (except maybe basic.t) into one test file, which I would prefer not to do for reasons of code organization. But I'm not writing any code tonight. Maybe tomorrow or the next day I will come up with something better, or maybe you can make clear to me what I do not see at the moment. Tom
Subject: Re: [rt.cpan.org #93358] tests fail: temp files being reused
Date: Thu, 27 Feb 2014 08:59:34 -0800
To: Tom Wyant via RT <bug-Mac-Pasteboard [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Wed, Feb 26, 2014 at 10:58:53PM -0500, Tom Wyant via RT wrote: Show quoted text
> What I think is happening is that the purpose of the module is to modify the clipboard using system services, and the different tests all use the same clipboards.
There is a newish mechanism in Test::Harness to indicate in tests "these tests should not be run in parallel"; I'll update this ticket when I find out more (it may not be fully functional yet, but this is a good opportunity to help make it so!)
leont on #toolchain also made a very intelligent suggestion that I hadn't thought of: use a lock file around the places where you must go serial.
I looked at the stuff in TAP::Harness, but could not find any way to influence the 'rules' setting, short of writing my own Makefile fragments and overloading the relevant Module::Build functionality. As for the lock file thing, there's no archive of #toolchain that I can find, and using a lock file seems like overkill anyway. What I'm leaning toward right now is just consolidating all the tests that touch the clipboard into one file.
Subject: Re: [rt.cpan.org #93358] tests fail: temp files being reused
Date: Fri, 28 Feb 2014 16:52:07 -0800
To: Tom Wyant via RT <bug-Mac-Pasteboard [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Fri, Feb 28, 2014 at 04:13:23PM -0500, Tom Wyant via RT wrote: Show quoted text
> As for the lock file thing, there's no archive of #toolchain that I can find, and using a lock file seems like overkill anyway. > What I'm leaning toward right now is just consolidating all the tests that touch the clipboard into one file.
That would work too :)
Low tech fix went to PAUSE yesterday as version 0.006_01. There's a subsequent version (_02) which was because I wanted to serve notice of intent to get rid of the question in the configuration scripts, and I figure fiddling with the tool chain needs to go through a development release.
Subject: Re: [rt.cpan.org #93358] tests fail: temp files being reused
Date: Sun, 2 Mar 2014 09:08:48 -0800
To: Tom Wyant via RT <bug-Mac-Pasteboard [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Sun, Mar 02, 2014 at 10:35:38AM -0500, Tom Wyant via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=93358 > > > Low tech fix went to PAUSE yesterday as version 0.006_01. There's a subsequent version (_02) which was because I wanted to serve notice of intent to get rid of the question in the configuration scripts, and I figure fiddling with the tool chain needs to go through a development release.
Awesome, it looks good and the install proceeded smoothly! thanks!
On Sun Mar 02 12:09:01 2014, ETHER wrote: Show quoted text
> On Sun, Mar 02, 2014 at 10:35:38AM -0500, Tom Wyant via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=93358 > > > > > Low tech fix went to PAUSE yesterday as version 0.006_01. There's a > > subsequent version (_02) which was because I wanted to serve notice > > of intent to get rid of the question in the configuration scripts, > > and I figure fiddling with the tool chain needs to go through a > > development release.
> > Awesome, it looks good and the install proceeded smoothly! thanks!
You're welcome, and thank you for reporting this. I typically let development versions sit for a week so see if the CPAN testers turn up anything, and then release a production version.