Closed Bug 902560 Opened 11 years ago Closed 11 years ago

All FakeProfileTestCase tests fail in setUp() if fake profile dir is not removed

Categories

(Android Background Services Graveyard :: Build & Test, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcomella, Assigned: mcomella)

References

Details

Attachments

(1 file)

FakeProfileTestCase attempts to create a new fake profile directory in FakeProfileTestCase.setUp(). If mkdir() fails on this directory (e.g. the directory already exists), setUp() will throw an IllegalStateException. A call to tearDown() should delete the fake profile directory and alleviate this but if tearDown() is not called (e.g. process crash), all future tests will fail in setUp() on mkdir(). This is especially pertinent because tests that fail in setUp() don't get to call tearDown() and so this fake profile dir will exist even after the current integration test suite has finished running. Thus ALL future test runs will fail, even in subsequent runs, until this directory is deleted. This could cause horrors with automated testing rigs so if we want to move these tests to tbpl, we should fix this (bug 709353). I came across this by overriding tearDown and not calling super.tearDown() from a subclass, which is another way to come across this bug.
Should (a) use a computed random dir for this, and (b) blow it away in setUp if it exists, no?
Assignee: nobody → michael.l.comella
We should use the changes in bug 870925 that add the FakeProfileTestCase.getCacheSuffix implementation.
Depends on: 870925
> We should use the changes in bug 870925 that add the FakeProfileTestCase.getCacheSuffix implementation. This can land, and bug 870925 will add the randomization rnewman mentioned in comment 1 (a).
Status: NEW → ASSIGNED
lgtm with naming nit (on github).
Flags: needinfo?(nalexander)
Don't forget that tests/ stuff lands on m-c now.
The randomness mentioned in comment 1 is helpful but not necessary to fix this bug. This randomness will land in bug 870925.
No longer depends on: 870925
Whiteboard: [fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: