Skip Menu |
 

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

Report information
The Basics
Id: 100411
Status: new
Priority: 0/
Queue: Test-Class

People
Owner: Nobody in particular
Requestors: dariusjokilehto [...] yahoo.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Ymail-Osg: DjAH9gcVM1mAJ2H5Zfdm0G2yUgVWgq.9P1NvNaWibcPFaDQtRwd.WLJxH0odhWh .ES3knCiNfVgAnmS0OnBBVzOickID.Y5Pi6sq1OZjNGoRaW8bl0_0ldM47wH_WWlPm4yGYcEIlH_ fBvYRawiyC4.hpe7K4jemMnCqUeRdcuL_aj80nnaO8dK6b4CUNFOz8uW3Y7iA3zygYXYpr7EEXAC 7gN21xm2ruDRa_S4VwuEnpsPAHW_L22N6kiyLhrbDzfpHY0k5xO5hHO4PSTzKWGbFEPAZv4GbCzT 8Or0EpVWNKeDAmmj81vbd157jVLSDrMHm7pspnrWdHrcP7WZkX5tC6eg2Fqzth6BXA3UjX4hqWCO kbNatGWmgBUQy9k4q09SANHe9thhkbAe2V3qQfZ6ELPgY1WuOk4R0U8vI2qV4VocDgvfE.PfDJLP i5D11oU.7mG1fnWZ9.B4ouvFI_dFMiN2iXauSfo.EcvZpg2.8gG2t6X6WcIZXmgegq6BIPXAL_B_ UcDBxTZci
X-Spam-Status: No, score=-0.1 tagged_above=-99.9 required=10 tests=[BAYES_40=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham
X-Yahoo-Newman-ID: 784512.54116.bm [...] omp1029.mail.ir2.yahoo.com
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <1050380097.89911.1416247420244.JavaMail.yahoo [...] jws11131.mail.ir2.yahoo.com>
Reply-To: Darius Jokilehto <dariusjokilehto [...] yahoo.co.uk>
X-Yahoo-Newman-Property: ymail-3
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -0.1
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 304BB240672 for <cpan-bug+Test-Class [...] hipster.bestpractical.com>; Mon, 17 Nov 2014 13:03:53 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B--hEsmcJqnZ for <cpan-bug+Test-Class [...] hipster.bestpractical.com>; Mon, 17 Nov 2014 13:03:52 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 16F7124008F for <bug-Test-Class [...] rt.cpan.org>; Mon, 17 Nov 2014 13:03:51 -0500 (EST)
Received: (qmail 28702 invoked by alias); 17 Nov 2014 18:03:49 -0000
Received: from nm35-vm1.bullet.mail.ir2.yahoo.com (HELO nm35-vm1.bullet.mail.ir2.yahoo.com) (212.82.97.124) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 17 Nov 2014 10:03:47 -0800
Received: from [212.82.98.54] by nm35.bullet.mail.ir2.yahoo.com with NNFMP; 17 Nov 2014 18:03:42 -0000
Received: from [212.82.98.92] by tm7.bullet.mail.ir2.yahoo.com with NNFMP; 17 Nov 2014 18:03:42 -0000
Received: from [127.0.0.1] by omp1029.mail.ir2.yahoo.com with NNFMP; 17 Nov 2014 18:03:42 -0000
Received: by 212.82.98.116; Mon, 17 Nov 2014 18:03:42 +0000
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] yahoo.co.uk
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=softfail (fail, message has been altered) header.from=dariusjokilehto [...] yahoo.co.uk
Delivered-To: cpan-bug+Test-Class [...] hipster.bestpractical.com
Subject: Test::Class modules in aggregate test run leak into subsequent run modules
Return-Path: <dariusjokilehto [...] yahoo.co.uk>
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=bVSt2quM14240RhCTbKXCIX+Ng6O4ABeG0FGnH2zHEyjip0KxUTxTBNC9K9Jn4GwhbBpuv/R158uRKCYB6agMtfG2UvjprDjZT25HtaLwqs7OoWzjDMuNDj5l2Ui8pO5BLUg2WXq0RGooPRAMolTdyUJ7zlhZkiowQqzlGL5gWcNmUiwOgKvlLpcTUTnrpbqtoL2p7Mt+99RMc+0Y6AmLGKEMHsHop29Tkaxa0ypqRf++kPR7nW1s0X/QxCxDv0BXcbKx53oxyg+nN1cFkqrgfSQq9B5NQuRRXr7qj5yI7D9JFQoo8tqlVpLGOmpkLiO1UzhCBPadkMDQ8OMuY51/g==;
X-RT-Mail-Extension: test-class
X-Original-To: cpan-bug+Test-Class [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1416247422; bh=x8X+ny5lPqJgYsJk9Vk0+ps0a+APZy8uwnmFpPzZdb0=; h=Date:From:Reply-To:To:Subject:From:Subject; b=rfWIF4qCLgJGC5csxweDz2XRitKsBmcMCidy6q1jzhr9OyARQiIqN9LDQeJlhxwhqwLZVR2bMgLqqL9/n5HgkrvlosZ4F/75gGTe4rwagSPZ0TCAJEXxEVhaBtqzNNd7e2Ju5b1NOJbUchzeHIyLBQX4eyRQ+3FJJx3XalruBqkt6hl8hUnIdizuOtD/bKsgtvU3eqBYxw1wmOET18IdeCHo+knUgF+keKGCw9O6yAcdqW5ymDNylftb5uLkI+CapAXjdG53PCOjwOQK1QTuwg0i/5t9RRZefeNVPvDQaZeHYtLk9bLA7iV1dBT723/F2OEiBZGdDQ2SUYgZGECJyw==
Date: Mon, 17 Nov 2014 18:03:40 +0000 (UTC)
X-Spam-Level:
To: "bug-Test-Class [...] rt.cpan.org" <bug-Test-Class [...] rt.cpan.org>
Content-Transfer-Encoding: 7bit
From: Darius Jokilehto <dariusjokilehto [...] yahoo.co.uk>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 1015
Download (untitled) / with headers
text/plain 1015b
In our test suite we have some Test::Class modules that all inherit from a subclass of Test::Class, and get run by a .t file that does the following: use Test::Class::Load "./t/classes"; Test::Class->runtests; We have recently been debugging some tests that create a mock object in their 'setup' method, and store it against $_[0]{mocked}, and it looks like this doesn't get destroyed once the test class module has finished running and moved onto the next module, which means our mocked objects leak into our next tests. I can't think of a case where this behaviour would be the desired one, I'd have thought the objects should get cleaned up once we've moved onto the next test class. Looking at the implementation, it seems the cause is this line in runtests: foreach my $t (@tests) { # stuff $t = $t->new unless ref($t); Since $t is an alias to an element of @tests, it won't be destroyed until the runtests method ends. You could just use a different variable to store the instance.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.