caolan / caolan/nodeunit

Test with nodeunit 0.5.3 hangs used to work with 0.5.1

Aperta
#83 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
1.9k
Fork
359
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Following test hangs with 0.5.3 but works with 0.5.1

``` javascript
var net = require('net');

exports['init-conn-test'] = function (test) {
var someServer = net.createServer();
var port = 1122;

var done = false;

var interval = setInterval(function() {
if (!done) {
test.ok(false, 'init-conn-test is expected to finish in 3 secs');
test.done();
}
try {
someServer.close();
}
catch(e) {
// eat it
}
clearInterval(interval);
}, 3000);

someServer.on('connection', function(sock) {
sock.on('data', function(data) {
lastEvent = data;
test.deepEqual(data.toString(), 'Testing123');
try {
someServer.close();
}
catch(e) {
// eat it
}
done = true;
clearInterval(interval);
test.done();
})
});

someServer.listen(port, 'localhost', function() {
var socket = net.createConnection(port, 'localhost');
socket.write('Testing123');
});
};
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.