Open Bug 1431133 Opened 6 years ago Updated 2 years ago

./mach web-platform-tests stalls and does not run without /etc/hosts entries on windows

Categories

(Testing :: web-platform-tests, defect)

Version 3
defect

Tracking

(Not tracked)

People

(Reporter: bkelly, Unassigned)

Details

Recently I noticed running:

 ./mach web-platform-tests

stopped working.  It would just get stuck after:

    bkelly@valen:/srv/mozilla-central$ ./mach web-platform-tests service-workers/service-worker
     0:03.20 INFO Using 1 client processes
     0:03.49 INFO Starting http server on web-platform.test:8000
     0:03.53 INFO Starting http server on web-platform.test:8001
     0:03.58 INFO Starting http server on web-platform.test:8443 

This is on a windows 10 machine in the WSL linux environment.  I'm not sure if it happens in windows under our mozilla-build shell.

The solution seems to be to manually add these entries to the WSL /etc/hosts:

127.0.0.1   web-platform.test
127.0.0.1   www.web-platform.test
127.0.0.1   www1.web-platform.test
127.0.0.1   www2.web-platform.test
127.0.0.1   xn--n8j6ds53lwwkrqhv28a.web-platform.test
127.0.0.1   xn--lve-6lad.web-platform.test
0.0.0.0     nonexistent-origin.web-platform.test
Before adding the /etc/hosts files I tried manually running wpt serve and got this error:

bkelly@valen:/srv/mozilla-central/testing/web-platform/tests$ python wpt.py serve
DEBUG:web-platform-tests:Going to use port 55097
DEBUG:web-platform-tests:Going to use port 55098
DEBUG:web-platform-tests:Going to use port 55099
DEBUG:web-platform-tests:Going to use port 55100
DEBUG:web-platform-tests:Route pattern: ^/(.*)$
DEBUG:web-platform-tests:Route pattern: ^/(.*\.py)$
DEBUG:web-platform-tests:Route pattern: ^/(.*\.asis)$
DEBUG:web-platform-tests:Route pattern: ^/(.*\.any\.worker\.js)$
DEBUG:web-platform-tests:Route pattern: ^/(.*\.any\.html)$
DEBUG:web-platform-tests:Route pattern: ^/(.*\.window\.html)$
DEBUG:web-platform-tests:Route pattern: ^/(.*\.worker\.html)$
DEBUG:web-platform-tests:Route pattern: ^/serve\.py$
DEBUG:web-platform-tests:Route pattern: ^/(?P<spec>[^/]+)/tools/(.*)$
DEBUG:web-platform-tests:Route pattern: ^/tools/(.*)$
DEBUG:web-platform-tests:Route pattern: ^/\_certs/(.*)$
DEBUG:web-platform-tests:Route pattern: ^/tools/runner/update\_manifest\.py$
DEBUG:web-platform-tests:Route pattern: ^/tools/runner/(.*)$
ERROR:web-platform-tests:Failed to start HTTP server. You may need to edit /etc/hosts or similar, see README.md.
Socket error on port 55100
Oh fun.  The windows WSL environment overwrites /etc/hosts when you open a new shell.
This is happening in my linux vmware guest as well.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.