Closed Bug 808764 Opened 12 years ago Closed 12 years ago

Android xpcshell tests do not set XPCOM_DEBUG_BREAK and some other env vars

Categories

(Testing :: General, defect)

x86
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla19

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file, 2 obsolete files)

With environment variable logging corrected (bug 808728), it is apparent that some environment variables set by make xpcshell-tests are not set for make xpcshell-tests-remote. For example:

XPCOM_DEBUG_BREAK, 
NS_TRACE_MALLOC_DISABLE_STACKS
XPCOM_MEM_LEAK_LOG
MOZ_CRASHREPORTER_NO_REPORT
Depends on: 768491
It's easy to set these, but doing so worsens bug 752126 - it makes the command line too long for adb.
Depends on: 752126
Blocks: 768491
No longer depends on: 768491
Set additional environment variables. With patches for bugs 752126, 808729 and this bug, the wrapper script now looks like this:

#!/system/bin/sh
export XPCOM_DEBUG_BREAK=stack-and-abort
export GRE_HOME=/data/data/org.mozilla.fennec_mozdev
export XPCOM_MEM_LEAK_LOG=/data/local/tests/xpcshell/p/leaks.log
export XPCSHELL_TEST_PROFILE_DIR=/data/local/tests/xpcshell/p
export HOME=/data/local/tests/xpcshell/p
export MOZ_CRASHREPORTER_NO_REPORT=1
export MOZ_LINKER_CACHE=/data/local/tests/xpcshell/b
export LD_LIBRARY_PATH=/data/local/tests/xpcshell/b
export TMPDIR=/data/local/tests/xpcshell/tmp
export NS_TRACE_MALLOC_DISABLE_STACKS=1
cd $1
echo xpcw: cd $1
shift
echo xpcw: xpcshell "$@"
/data/local/tests/xpcshell/b/xpcshell "$@"
Attachment #678521 - Attachment is obsolete: true
Attachment #680414 - Flags: review?(jmaher)
Comment on attachment 680414 [details] [diff] [review]
Set XPCOM_DEBUG_BREAK, etc env vars

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

::: testing/xpcshell/remotexpcshelltests.py
@@ +262,5 @@
> +        self.env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
> +        # Capturing backtraces is very slow on some platforms, and it's
> +        # disabled by automation.py too
> +        self.env["NS_TRACE_MALLOC_DISABLE_STACKS"] = "1"
> +        self.env["XPCOM_MEM_LEAK_LOG"] = self.remoteJoin(self.profileDir, "leaks.log")

couldn't we do:
self.env = XPCShellTests.buildEnvironment(self)

We would have to modify the XPCShellTests version to find a way to start with self.enf = {} instead of os.environ.
Attachment #680414 - Flags: review?(jmaher) → review-
I couldn't find a reasonable way to make XPCShellTests.buildEnvironment generic, so this moves the cross-platform env vars into a new function and calls the new function from both XPCShellTests and the remote override.
Attachment #680414 - Attachment is obsolete: true
Attachment #680762 - Flags: review?(jmaher)
Comment on attachment 680762 [details] [diff] [review]
Set XPCOM_DEBUG_BREAK, etc env vars

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

thanks!
Attachment #680762 - Flags: review?(jmaher) → review+
https://hg.mozilla.org/mozilla-central/rev/dd9da0173949
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: