Closed Bug 752126 Opened 9 years ago Closed 9 years ago

some xpcshell tests via adb fail because the command line is too long

Categories

(Testing :: XPCShell Harness, defect)

x86
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla19

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

When running Android xpcshell tests via adb, if the command line passed to "adb shell" exceeds about 1024 characters, the command fails to execute, and the test fails with no diagnostics logged. Attempts have been made to reduce the xpcshell test command line to avoid this limitation, but it still occurs for some tests, like most of the tests in modules/libjar/zipwriter/test/unit (zipwriter tests have special head and tail files that lengthen the command).

I want to look at the command line creation to see if paths can be further abbreviated.

I also want to reinstate a warning message in devicemanagerADB to warn / notify when this happens.
I haven't found a reliable way forward on this...not sure if we can do anything about it.
Assignee: gbrown → nobody
We could plausibly write out temp .js files and use those as "response files". Like instead of calling "xpcshell -f head.js -f head_something.js -f test.js" we could write out:
temp.js
--------
load("head.js")
load("head_something.js")
load("test2.js");
--------

and then just run "xpcshell -f temp.js"
Blocks: 808764
Blocks: 808729
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #2)

Thanks Ted! I think that would work, but...it would introduce a file push per test, slowing down an already slow process. That got me thinking about using a wrapper script that could be written once and re-used for each test. For example, all of the env vars are the same for all tests, and specifying those on the command line takes about 400 characters. We could use something like:

#!/system/bin/sh
export XPCOM_DEBUG_BREAK=stack-and-abort
export GRE_HOME=/data/data/org.mozilla.fennec_mozdev
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
shift
/data/local/tests/xpcshell/b/xpcshell $@


There is a complication with proper quoting of $@...I'm working through that now.
Assignee: nobody → gbrown
On setup (buildEnvironment), create a shell script similar to that shown in comment 3 and push it to the device. Then change the per-test launch command to call the script, without the cwd or env now specified in the script.
Attachment #680410 - Flags: review?(jmaher)
Comment on attachment 680410 [details] [diff] [review]
use wrapper script for launching xpcshell

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

this is a hack, but it is documented.
Attachment #680410 - Flags: review?(jmaher) → review+
https://hg.mozilla.org/mozilla-central/rev/8d3046ee2f00
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.