Use registerCleanupFunction in our tests

RESOLVED FIXED

Status

Firefox Graveyard
Panorama
P3
normal
RESOLVED FIXED
7 years ago
a year ago

People

(Reporter: iangilman, Unassigned)

Tracking

Details

(Reporter)

Description

7 years ago
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.
 }
(Reporter)

Updated

7 years ago
Blocks: 585689
No longer blocks: 585689
Blocks: 603789

Comment 1

6 years ago
bugspam
No longer blocks: 603789
Blocks: 653099
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?
(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.
bugspam
No longer blocks: 653099
bugspam
Blocks: 660175
bugspam

(Fx7 was branched, removing open bugs from Fx7 meta bug, we won't create new meta bugs for upcoming Fx versions)
No longer blocks: 660175
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.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

a year ago
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.