[mozprofile] tests do not remove created directories

RESOLVED FIXED in Firefox 41

Status

Testing
Mozbase
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: parkouss, Assigned: parkouss)

Tracking

unspecified
mozilla41
Points:
---

Firefox Tracking Flags

(firefox41 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
I just checked mozbase/mozprofile/tests/test_clone_cleanup.py b/testing/mozbase/mozprofile/tests/test_clone_cleanup.py, it does not clean temporary profiles folders that it creates, even when tests are a success.

Well we should clean that, and this is pretty easy with the addCleanup method on TestCase class present in python 2.7.
(Assignee)

Comment 1

3 years ago
I *wonder* if it is related to some kind of intermittent failures like in bug 1159435. From what I can understand, looking at https://code.google.com/p/nativeclient/issues/detail?id=3631, it could be that we have too many temp folders created (well existing at the time of a new call) with the python tempfile module.
(Assignee)

Comment 2

3 years ago
Created attachment 8623608 [details] [diff] [review]
1173682.patch

I found a few others folders/files created while running unit tests in other packages (not only mozprofile).

I fixed them as well. On ubuntu, I got the tests running fine and all temp files and folders are removed.
Attachment #8623608 - Flags: review?(ahalberstadt)
Comment on attachment 8623608 [details] [diff] [review]
1173682.patch

Review of attachment 8623608 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, looks good! I didn't know about addCleanup.
Attachment #8623608 - Flags: review?(ahalberstadt) → review+
(Assignee)

Comment 4

3 years ago
Cool! Yeah, addCleanup is a nice python 2.7 feature - cleanup tests on success AND failure. :)

Pushed to try:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=d32df814b882
https://hg.mozilla.org/mozilla-central/rev/696e5a7a22c2
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox41: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.