Closed Bug 821033 Opened 12 years ago Closed 11 years ago

TestFile fails on Android: "main Creating temp directory, rv=80004005"

Categories

(Testing :: General, defect)

x86
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla20

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file, 2 obsolete files)

With the patch for bug 811411, we can run unit tests on Android...but some tests fail.

TestFile fails consistently with:

Running nsLocalFile tests...
TEST-UNEXPECTED-FAIL | main Creating temp directory, rv=80004005
Finished running nsLocalFile tests.
remotecppunittests TEST-UNEXPECTED-FAIL | TestFile | test failed with return code 1
Blocks: 811411
...but it passes just fine if we simply define a TMPDIR environment variable:

Running nsLocalFile tests...
TEST-PASS | Setup
TEST-PASS | AppendNative with invalid file name
TEST-PASS | GetParent
TEST-PASS | Create file
TEST-PASS | Remove file
TEST-PASS | Create directory
TEST-PASS | MoveTo rename file
TEST-PASS | CopyTo copy file
TEST-PASS | MoveTo move file
TEST-PASS | MoveTo move and rename file
TEST-PASS | CopyTo copy file across directories
TEST-PASS | Normalize with native paths
TEST-PASS | Remove directory
TEST-PASS | CreateUnique file
TEST-PASS | CreateUnique directory
TEST-PASS | OpenNSPRFileDesc DELETE_ON_CLOSE
Finished running nsLocalFile tests.
Define TMPDIR in environment. 

I have also seen problems in xpcshell tests when HOME is not defined, so adding that as well.
Attachment #691526 - Flags: review?(dmose)
Comment on attachment 691526 [details] [diff] [review]
define TMPDIR and HOME in unit test env

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

::: testing/remotecppunittests.py
@@ +79,5 @@
>      def buildEnvironment(self):
>          env = self.buildCoreEnvironment( {} )
>          env['LD_LIBRARY_PATH'] = self.remoteBinDir
> +        env["TMPDIR"]=self.remoteTmpDir
> +        env["HOME"]=self.remoteTmpDir

You might want to make TMPDIR and HOME not point to the same directly, working on theory that this would make the execution environment for the unit tests more like the execution environment Fennec is likely to run under.

In practice, I'm not convinced this is likely to be a problem in real life, so r=dmose with or without that change.
Attachment #691526 - Flags: review?(dmose) → review+
One thing that occurs to me after the fact is that for the tests I'm running, MOZ_WEBRTC_TESTS must be set to 1 in the environment.  So maybe there really wants to be a more generic hook for setting environment variables on the target.
(In reply to Dan Mosedale (:dmose) from comment #4)
> One thing that occurs to me after the fact is that for the tests I'm
> running, MOZ_WEBRTC_TESTS must be set to 1 in the environment.  So maybe
> there really wants to be a more generic hook for setting environment
> variables on the target.

Filed bug 821425 for this.
Updated as suggested in comment 3. r=dmose
Attachment #691526 - Attachment is obsolete: true
Attachment #692362 - Flags: review+
No longer blocks: 811411
Depends on: 811411
Re-based for new patch on bug 811411.
Attachment #692362 - Attachment is obsolete: true
Attachment #697461 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/79e3ae509764
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: