nodeunit icon indicating copy to clipboard operation
nodeunit copied to clipboard

Test with nodeunit 0.5.3 hangs used to work with 0.5.1

Open shimonchayim opened this issue 13 years ago • 3 comments

Following test hangs with 0.5.3 but works with 0.5.1

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');
    });
};

shimonchayim avatar Jul 19 '11 21:07 shimonchayim

Suffering from this issue as well, can confirm this is a problem.

dinedal avatar Jul 26 '11 17:07 dinedal

+1 This issue is present on Centos and not seen on OSX - version >0.5.1

mattyod avatar Oct 19 '11 13:10 mattyod

+1

aaronfranco avatar May 31 '15 05:05 aaronfranco