Last Comment Bug 603820 - Use registerCleanupFunction in our tests
: Use registerCleanupFunction in our tests
Status: RESOLVED FIXED
:
Product: Firefox Graveyard
Classification: Graveyard
Component: Panorama (show other bugs)
: unspecified
: All All
: P3 normal
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-12 16:13 PDT by Ian Gilman [:iangilman]
Modified: 2016-04-12 14:00 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Ian Gilman [:iangilman] 2010-10-12 16:13:48 PDT
As noted in bug 603530, our test failures wouldn't cascade if we use registerCleanupFunction. We should update our existing tests to use this function. 

From https://developer.mozilla.org/en/Browser_chrome_tests : 

If you need to do special clean up after running your test, you can register a cleanup function that is guaranteed to be run after your test finishes. You can call registerCleanupFunction() at any point in your test, even in head.js if you need to register a clean up function for all tests in that folder. Notice that you can register as many clean up functions as you will. Clean up functions are also guaranteed to be called if your test timeouts, so you can ensure that in case of timeouts you won't pollute next running tests and causing them to fail.

 registerCleanupFunction(function() {
   // Clean up test related stuff here.
 });

 function test() {
   // Add some test related stuff.
 }
Comment 1 Kevin Hanes 2011-03-31 10:52:09 PDT
bugspam
Comment 2 Raymond Lee [:raymondlee] 2011-05-25 00:01:30 PDT
We are using registerCleanupFunction in our new tests.  

What should we do with this bug now?  Shall we check all tests and add registerCleanupFunction to them?
Comment 3 Tim Taubert [:ttaubert] 2011-05-25 02:10:47 PDT
(In reply to comment #2)
> What should we do with this bug now?  Shall we check all tests and add
> registerCleanupFunction to them?

I think we should have a look at all our older tests and add registerCleanupFunction() only where it seems important - like new windows and prefs, private browsing, etc.
Comment 4 Tim Taubert [:ttaubert] 2011-05-27 02:23:59 PDT
bugspam
Comment 5 Tim Taubert [:ttaubert] 2011-05-27 02:28:56 PDT
bugspam
Comment 6 Tim Taubert [:ttaubert] 2011-07-24 18:39:53 PDT
bugspam

(Fx7 was branched, removing open bugs from Fx7 meta bug, we won't create new meta bugs for upcoming Fx versions)
Comment 7 Tim Taubert [:ttaubert] 2011-12-01 22:10:14 PST
Marking this as fixed because most of our tests do now use registerCleanupFunction(), newly written tests have to use it where appropriate and we haven't had cascading failures for quite a while.

Note You need to log in before you can comment on or make changes to this bug.