Closed Bug 898903 Opened 7 years ago Closed 7 years ago

Cannot run mochitest on Windows

Categories

(Testing :: Mochitest, defect)

x86_64
Windows 8
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla25

People

(Reporter: emk, Assigned: emk)

References

Details

(Keywords: regression)

Attachments

(1 file)

$ TEST_PATH=dom/tests/mochitest/general/test_interfaces.html ./build/pymake/mak
e.py -C obj-i686-pc-mingw32 mochitest-plain
make.py[0]: Entering directory 'h:\m\mozilla-central\obj-i686-pc-mingw32'
h:\m\mozilla-central\testing\testsuite-targets.mk:124:0$ rm -f ./mochitest-plain
.log && h:/m/mozilla-central/obj-i686-pc-mingw32/_virtualenv/Scripts/python.exe
_tests/testing/mochitest/runtests.py --autorun --close-when-done --console-level
=INFO --log-file=./mochitest-plain.log --file-level=INFO --failure-file=h:/m/moz
illa-central/obj-i686-pc-mingw32/_tests/testing/mochitest/makefailures.json --te
sting-modules-dir=h:/m/mozilla-central/obj-i686-pc-mingw32/_tests/modules --extr
a-profile-file=./dist/plugins --symbols-path=./dist/crashreporter-symbols --test
-path="dom/tests/mochitest/general/test_interfaces.html"
Mochitest INFO | runtests.py | Installing extension at h:\m\mozilla-central\obj-
i686-pc-mingw32\_tests\testing\mochitest\extensions\specialpowers to c:\users\ki
mu\appdata\local\temp\tmpl9j_tr.
Mochitest INFO | runtests.py | Installing extension at h:\m\mozilla-central\obj-
i686-pc-mingw32\_tests\testing\mochitest\extensions\worker to c:\users\kimu\appd
ata\local\temp\tmpl9j_tr.
Mochitest INFO | runtests.py | Installing extension at h:\m\mozilla-central\obj-
i686-pc-mingw32\_tests\testing\mochitest\extensions\workerbootstrap to c:\users\
kimu\appdata\local\temp\tmpl9j_tr.
Mochitest INFO | runtests.py | Installing extension at h:\m\mozilla-central\obj-
i686-pc-mingw32\_tests\testing\mochitest\mochijar to c:\users\kimu\appdata\local
\temp\tmpl9j_tr.
args: [u'h:\\m\\mozilla-central\\obj-i686-pc-mingw32\\dist\\bin\\xpcshell.exe',
'-g', u'h:\\m\\mozilla-central\\obj-i686-pc-mingw32\\dist\\bin', '-v', '170', '-
f', 'h:\\m\\mozilla-central\\obj-i686-pc-mingw32\\_tests\\testing\\mochitest/htt
pd.js', '-e', "const _PROFILE_PATH = 'c:\\\\users\\\\kimu\\\\appdata\\\\local\\\
\temp\\\\tmpl9j_tr';const _SERVER_PORT = '8888'; const _SERVER_ADDR = '127.0.0.1
';\n                     const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS
= false;", '-f', './server.js']
Traceback (most recent call last):
  File "_tests/testing/mochitest/runtests.py", line 682, in <module>
  File "_tests/testing/mochitest/runtests.py", line 679, in main
  File "_tests/testing/mochitest/runtests.py", line 516, in runTests
  File "_tests/testing/mochitest/runtests.py", line 283, in startWebServer
  File "_tests/testing/mochitest/runtests.py", line 86, in start
  File "h:\m\mozilla-central\obj-i686-pc-mingw32\_tests\testing\mochitest\automa
tion.py", line 201, in __init__
    universal_newlines, startupinfo, creationflags)
  File "c:\mozilla-build\python\Lib\subprocess.py", line 711, in __init__
    errread, errwrite)
  File "c:\mozilla-build\python\Lib\subprocess.py", line 948, in _execute_child
    startupinfo)
TypeError: environment can only contain strings
h:\m\mozilla-central\testing\testsuite-targets.mk:124:0: command 'rm -f ./mochit
est-plain.log && h:/m/mozilla-central/obj-i686-pc-mingw32/_virtualenv/Scripts/py
thon.exe _tests/testing/mochitest/runtests.py --autorun --close-when-done --cons
ole-level=INFO --log-file=./mochitest-plain.log --file-level=INFO --failure-file
=h:/m/mozilla-central/obj-i686-pc-mingw32/_tests/testing/mochitest/makefailures.
json --testing-modules-dir=h:/m/mozilla-central/obj-i686-pc-mingw32/_tests/modul
es --extra-profile-file=./dist/plugins --symbols-path=./dist/crashreporter-symbo
ls --test-path="dom/tests/mochitest/general/test_interfaces.html" ' failed, retu
rn code 1
Reverting bug 865349 fixed the issue locally.
Blocks: 865349
Depends on: 898904
Keywords: regression
If I executed the test from mach, I got a different error:

The details of the failure are as follows:

AttributeError: 'NoneType' object has no attribute 'startswith'

  File "h:\m\mozilla-central\testing/mochitest/mach_commands.py", line 268, in r
un_mochitest_plain
    return self.run_mochitest(test_file, 'plain', **kwargs)
  File "h:\m\mozilla-central\testing/mochitest/mach_commands.py", line 299, in r
un_mochitest
    **kwargs)
  File "h:\m\mozilla-central\testing/mochitest/mach_commands.py", line 93, in ru
n_mochitest_test
    ('.py', 'r', imp.PY_SOURCE))
  File "h:\m\mozilla-central\obj-i686-pc-mingw32\_tests\testing\mochitest\runtes
ts.py", line 26, in <module>
    from mochitest_options import MochitestOptions
  File "h:\m\mozilla-central\obj-i686-pc-mingw32\_tests\testing\mochitest\mochit
est_options.py", line 17, in <module>
    build_obj = MozbuildObject.from_environment()
  File "h:\m\mozilla-central\python/mozbuild\mozbuild\base.py", line 166, in fro
m_environment
    topobjdir = os.path.normpath(config['topobjdir'] or topobjdir)
  File "c:\mozilla-build\python\lib\ntpath.py", line 402, in normpath
    if path.startswith(('\\\\.\\', '\\\\?\\')):
When from_environment() is called from mach, the cwd was "h:\m\mozilla-central". (This is my srcdir.)
But when from_environment() is called from pymake, the cwd was "h:\m\mozilla-central\obj-i686-pc-mingw32" and "h:\m\mozilla-central\obj-i686-pc-mingw32\_tests\testing\mochitest".
If I revert bug 865349, from_environment() is not called at all.
This line made env["PATH"] Unicode.

https://mxr.mozilla.org/mozilla-central/source/build/automation.py.in#736
>    elif self.IS_WIN32:
>      env["PATH"] = env["PATH"] + ";" + ldLibraryPath
This patch worked for me when I'm using pymake. I'll file a followup mach bug (if it is not a dupe).
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #782819 - Flags: review?(jgriffin)
According to bug 898725 comment #2, this is not Japanese specific.
No longer depends on: 898904
Summary: Cannot run mochitest on Japanese Windows → Cannot run mochitest on Windows
Comment on attachment 782819 [details] [diff] [review]
Prevent becoming env["PATH"] to Unicode on Windows

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

Thanks for the fix.
Attachment #782819 - Flags: review?(jgriffin) → review+
(In reply to Masatoshi Kimura [:emk] from comment #2)
> If I executed the test from mach, I got a different error:
> 
> The details of the failure are as follows:
> 
> AttributeError: 'NoneType' object has no attribute 'startswith'
> 
>   File "h:\m\mozilla-central\testing/mochitest/mach_commands.py", line 268,
> in r
> un_mochitest_plain
>     return self.run_mochitest(test_file, 'plain', **kwargs)
>   File "h:\m\mozilla-central\testing/mochitest/mach_commands.py", line 299,
> in r
> un_mochitest
>     **kwargs)
>   File "h:\m\mozilla-central\testing/mochitest/mach_commands.py", line 93,
> in ru
> n_mochitest_test
>     ('.py', 'r', imp.PY_SOURCE))
>   File
> "h:\m\mozilla-central\obj-i686-pc-mingw32\_tests\testing\mochitest\runtes
> ts.py", line 26, in <module>
>     from mochitest_options import MochitestOptions
>   File
> "h:\m\mozilla-central\obj-i686-pc-mingw32\_tests\testing\mochitest\mochit
> est_options.py", line 17, in <module>
>     build_obj = MozbuildObject.from_environment()
>   File "h:\m\mozilla-central\python/mozbuild\mozbuild\base.py", line 166, in
> fro
> m_environment
>     topobjdir = os.path.normpath(config['topobjdir'] or topobjdir)
>   File "c:\mozilla-build\python\lib\ntpath.py", line 402, in normpath
>     if path.startswith(('\\\\.\\', '\\\\?\\')):

This is bug 899292
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b0a220412a58
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.