Dirtied resources are recreated even if they won't be needed again

Bug #271257 reported by James Henstridge
2
Affects Status Importance Assigned to Milestone
testresources
Fix Released
Medium
Jonathan Lange

Bug Description

If we have a test inside an OptimisingTestSuite that requires a resource but dirties it, the finishedWith() call in the test's tear down will clean the resource and create a new one (since the use count is greater than zero). If there are no more tests that require the resource, OptimisingTestSuite will call finishedWith() again right after cleaning the newly created resource without it ever being used.

This doesn't result in incorrect behaviour, but is wasted effort (which should probably be considered a bug since the whole idea of testresources is to remove unnecessary setup/teardown of resources).

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 271257] [NEW] Dirtied resources are recreated even if they won't be needed again

Can you please try with jml's approved [but not merged yet, mea culpa]
branch; this changes a few things, and you probably want to adjust for
it anyhow, if it has the problem we'll confirm this bug.

-Rob

Revision history for this message
James Henstridge (jamesh) wrote :

Attached is a patch against jml's branch that tests this bug and bug 271249.

The testDirtiedResourceNotRecreated test fails (the resource is created a second time) so his branch does not fix this one. The other test passes though, so bug 271249 looks to be fixed.

Jonathan Lange (jml)
Changed in testresources:
assignee: nobody → jml
status: New → Confirmed
Jonathan Lange (jml)
Changed in testresources:
importance: Undecided → Medium
status: Confirmed → Triaged
Jonathan Lange (jml)
Changed in testresources:
status: Triaged → Fix Committed
Revision history for this message
Robert Collins (lifeless) wrote :

Setting to in progress - jamesh has put up a test that shows the fix in jmls branch was incomplete.

Changed in testresources:
status: Fix Committed → In Progress
Changed in testresources:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.