caolan / caolan/nodeunit

Test with nodeunit 0.5.3 hangs used to work with 0.5.1

未关闭
#83 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
1.9k
派生
359
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先使用 nodeunit 0.5.3 和 0.5.1 运行所提供的测试,以重现挂起问题并比较行为。跟踪测试运行器对异步 net 服务器、套接字、间隔计时器以及 test.done 调用的处理方式。在不更改测试预期断言的情况下,测试在 0.5.3 上于预期时间内完成,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js
领域
backend, testing-qa
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。