remove airplaine dependency for tests/test_back.js#L137#1079
Conversation
| response.writeHead(200) | ||
| response.end() | ||
| }) | ||
| server.listen(0, () => { |
There was a problem hiding this comment.
Will the tests run in parallel? Because, it would be tough to figure out the behaviour of our tests in such a case if all of them use port 0 to setup the local server.
Do you think it makes sense to persist the server across tests, if they all are in the same file?
I also have some concerns with the usage of port 0 which is reserved for TCP/IP networking to do some fancy socket programming things. We can probably just use good 'ol 80(80) if we decide to persist the server?
There was a problem hiding this comment.
setting port to 0 lets the server pick an available port, so there won’t be any conflicts, see https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback
Turns out the 0 argument can be omitted altogether, I’ll give this a try :)
300a340 to
de5279c
Compare
| response.writeHead(200) | ||
| response.end() | ||
| }) | ||
| server.listen(() => { |
There was a problem hiding this comment.
Note that server.listen(() => {...}) will automatically get an available port assigned, so tests can run in parallel without conflicts, see server.listen([port][, host][, backlog][, callback])
There was a problem hiding this comment.
Oh btw, you need the semi-colons ;)
There was a problem hiding this comment.
lol yeah we can put in proper syntax rules once we addressed the existing issues & PRs. I’ll add prettier, but not yet. For now it's wild wild west I don’t care
| host: 'localhost', | ||
| path: '/', | ||
| port: server.address().port | ||
| }, (response) => { |
c29da8e to
39d30bf
Compare
|
no idea why this was auto-closed lol |
|
oh okay, I didn’t actually work on tests/test_back.js#L137 oops |
|
see my follow up at #1083 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you! |
closes #1078, part of #1077