Open andrewmunro opened 8 years ago
Hmm, it seems to be an issue with creating http servers on workers in general. The server still runs, though:
var cluster = require("cluster");
if (cluster.isMaster) {
cluster.fork();
}
else {
var http = require('http');
var server = http.createServer(function(req, res) { res.end('ok'); });
server.listen(process.env.PORT || 8080);
console.log('Server address: ' + server.address());
}
I have been unable to find an explaination of this behavior, though.
I'm having the same issue. I had to replace piping
with nodemon
for tests to work (using mocha
). This issue was not apparent until I tried testing an express server with supertest, as supertest
makes heavy use of app.server.address()
.
I have my piping code setup as such:
For some odd reason, when running this simple app with piping,
app.server.address()
returns null. If I run this code without piping, it returns the port as expected.Using
"express": "^4.13.4"
and"piping": "^0.3.0",
Any ideas?