disable unreliable test

This commit is contained in:
Benjamin Pasero 2016-04-29 07:35:31 +02:00
parent dc07215d7d
commit 610113e2d4

View file

@ -31,24 +31,25 @@ suite('Ports', () => {
});
});
test('Finds a free port (with timeout)', function (done: () => void) {
// Unreliable test:
// test('Finds a free port (with timeout)', function (done: () => void) {
// get an initial freeport >= 7000
ports.findFreePort(7000, 100, 300000, (initialPort) => {
assert.ok(initialPort >= 7000);
// // get an initial freeport >= 7000
// ports.findFreePort(7000, 100, 300000, (initialPort) => {
// assert.ok(initialPort >= 7000);
// create a server to block this port
const server = net.createServer();
server.listen(initialPort, null, null, () =>  {
// // create a server to block this port
// const server = net.createServer();
// server.listen(initialPort, null, null, () =>  {
// once listening, find another free port and assert that the port is different from the opened one
ports.findFreePort(7000, 50, 0, (freePort) => {
assert.equal(freePort, 0);
server.close();
// // once listening, find another free port and assert that the port is different from the opened one
// ports.findFreePort(7000, 50, 0, (freePort) => {
// assert.equal(freePort, 0);
// server.close();
done();
});
});
});
});
// done();
// });
// });
// });
// });
});