Bug 1355207 - Wait for http server shutdown and disable test_host.js on OSX r=dragana

The test intermittently fails on OSX. For some reason start(PORT) doesn't always fail when PORT is in use, so we timeout because the handler is never called. I suspect it's because of how SO_REUSEADDR and SO_REUSEPORT are handled on sockets sever-side on OSX. Since httpd is used for unit tests, there is little risk in disabling the test on OSX.
The alternative is to check for a timeout, and in that case switch to another port - which is cumbersome, and not the purpose of the test.

Differential Revision: https://phabricator.services.mozilla.com/D14756

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Valentin Gosu 2018-12-18 11:14:14 +00:00
Родитель 76238bc575
Коммит f9762144c9
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -180,7 +180,10 @@ add_task(async function run_test_3() {
// Okay, finally done with identity testing. Our primary location is the one
// we want it to be, so we're off!
runRawTests(tests, () => { srv.stop(); }, (idx) => dump(`running test no ${idx}`));
await new Promise(resolve => runRawTests(tests, resolve, (idx) => dump(`running test no ${idx}`)));
// Finally shut down the server.
await new Promise(resolve => srv.stop(resolve));
});

Просмотреть файл

@ -13,7 +13,7 @@ support-files = data/** ../httpd.js
[test_header_array.js]
[test_headers.js]
[test_host.js]
skip-if = (verify && debug && (os == 'mac'))
skip-if = os == 'mac'
run-sequentially = Reusing same server on different specific ports.
[test_linedata.js]
[test_load_module.js]