Closed Bug 420238 Opened 16 years ago Closed 16 years ago

SyntaxError: illegal character in nsURLFormatter.js:0 when starting Mochitests

Categories

(Testing :: Mochitest, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: alqahira, Unassigned)

Details

I'm working on figuring out what needs to be done to get Camino running tests so we have coverage of Gecko in an embedding environment (e.g., bug 401328 and another bad one I can't find right now where Boris and I talked about whether a Mochitest would have caught it).

When I build (debug) with --enable-tests, go to $(OBJDIR)/_tests/testing/mochitest, fix-up the app path in runtests.pl and perl runtests.pl --autorun (or any subset), I get an error soon after the harness starts:

/Users/smokey/Camino/dev/trunk/CaminoTrunkTests/_tests/testing/mochitest/../../../dist/bin/xpcshell -v 170  -f "/Users/smokey/Camino/dev/trunk/CaminoTrunkTests/_tests/testing/mochitest/httpd.js" -f "/Users/smokey/Camino/dev/trunk/CaminoTrunkTests/_tests/testing/mochitest/server.js"
WARNING: Could not load XPT Zip loader: file /Users/smokey/Camino/dev/trunk/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp, line 1022
*** registering nsContentPrefService.js: [ Content Pref Service, Hostname Grouper ]
JS Component Loader: ERROR file:///Users/smokey/Camino/dev/trunk/CaminoTrunkTests/dist/bin/components/nsURLFormatter.js:0
                     SyntaxError: illegal character
Error starting application: No such file or directory
FAIL Exited with code 512 during test run
kill TERM 32064
Process killed. Took 2 seconds to die.
 started: Fri Feb 29 01:40:38 2008
finished: Fri Feb 29 01:40:40 2008

/Users/smokey/Camino/dev/trunk/CaminoTrunkTests/dist/bin/components/nsURLFormatter.js exists; it seems to be identical to the copy in mozilla/toolkit/components/urlformatter/src/

I've tried specifying the --console-level or --file-level flags/options, but it provides no more information on the error.
I speculate the file isn't getting preprocessed, since the file includes #-style comments.

The -level options are meant for use in controlling test harness output; they do not affect anything until the individual Mochitests start running.

I'm building Camino now to investigate this problem and see what other problems might or might not remain.  By the way, thanks for getting rid of that obnoxious shared-menus thing -- I got it to work once, but I failed miserably the last time I tried.  With any luck the probably-in-tree version will Just Work.
Also, use runtests.py instead of runtests.pl.  The former is slowly dying and being replaced by the latter (which has essentially equivalent functionality), and I'm at the point where I'm not willing to bother to update the former with new functionality.
Er, switch latter and former around in that last.  Perl is dead, long live Python.
I can't reproduce the problem you report.

First thing I run into when I try doing this is the "-bin"-adding logic in build/pgo/automation.py, for converting firefox to firefox-bin.  I think, with the necessary changes elsewhere, we can remove that, although I don't know a good way to warn not to use the non-bin version.  You probably also want to change build/pgo/Makefile.in so that you don't have to provide --app every time, which should be fairly simple.

Second, after commenting out the -bin code, Camino runs and everything, but the test URL doesn't load:

The file /Users/jwalden/moz/builds/camino/_tests/testing/mochitest/http:/localhost:8888/tests cannot be found. Please check the location and try again.

Just running path/to/Camino.app/Contents/MacOS/Camino http://google.com/ fails, so I smell a bug in your commandline handling.

By the way, you're leaking 1100 bytes just starting up and shutting down, it seems.  Apply the patch in bug 420154 for prettier UI (same info available without the patch, just harder to get), then run (with the -bin change still, in a debug build or one with --enable-logrefcnt):

python runtests.py --appname=/absolute/path/to/Camino.app/Contents/MacOS/Camino --leak-threshold=0

ERROR FAIL leaked 1100 bytes during test execution (should have leaked no more than 0 bytes)
ERROR FAIL leaked 1 instance of FormFillListener with size 16 bytes
ERROR FAIL leaked 1 instance of KeychainAutoCompleteDOMListener with size 20 bytes
ERROR FAIL leaked 1 instance of RemoteURILoadManager with size 64 bytes
ERROR FAIL leaked 1 instance of morkFactory with size 136 bytes
ERROR FAIL leaked 1 instance of morkObject with size 44 bytes
ERROR FAIL leaked 2 instances of nsCacheSession with size 32 bytes each (64 bytes total)
ERROR FAIL leaked 1 instance of nsHashtable with size 44 bytes
ERROR FAIL leaked 1 instance of nsLoadGroup with size 8 bytes
ERROR FAIL leaked 1 instance of nsLocalFile with size 108 bytes
ERROR FAIL leaked 1 instance of nsObserverService with size 48 bytes
ERROR FAIL leaked 1 instance of nsPref with size 44 bytes
ERROR FAIL leaked 3 instances of nsPrefBranch with size 56 bytes each (168 bytes total)
ERROR FAIL leaked 1 instance of nsPrefService with size 40 bytes
ERROR FAIL leaked 1 instance of nsSimpleGlobalHistory with size 192 bytes
ERROR FAIL leaked 10 instances of nsStringBuffer with size 8 bytes each (80 bytes total)
ERROR FAIL leaked 6 instances of nsVoidArray with size 4 bytes each (24 bytes total)
Thanks for all the investigation here, Jeff.  It's possible my tests tree was just too old; I'm rebuilding it now, and I'll try the python version (http://developer.mozilla.org/en/docs/Mochitest#How_do_I_get_started.3F only mentions the perl version).

The bin stuff is some sort of artifact of old build system assumptions (http://mxr.mozilla.org/mozilla/source/camino/installer/Makefile.in#73) that must not yet be fixed since mento still has that in there, but as you note that's easy to at least work-around/special-case.

The command-line handling stuff is probably a "bug" in that, AIUI, we basically only support the bare minimum required to get tinderbox Tp/Tdhtml tests to run.  Our userbase doesn't have much use for that ;)

As long as I can get past the comment 0 error, I guess we can close this and I'll file other bugs as appropriate.
I have no idea why that file didn't get preprocessed before, but I can no longer reproduce that error with a fresh rebuild of that tree.

With a couple of changes ("gross hacks") I'm able to get tests (auto)running, so I'll file other bugs as those changes become less hacky.

Thanks again, Jeff.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Component: Testing → Mochitest
Product: Core → Testing
QA Contact: testing → mochitest
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.