Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tweak test to still fail but remove Math.random()

  • Loading branch information...
commit 824f35f497ca2a7117141f0f1f2d7e848c1be404 1 parent 51eba6d
@substack authored
Showing with 11 additions and 12 deletions.
  1. +11 −12 test/recon.js
View
23 test/recon.js
@@ -25,8 +25,8 @@ function runProc (fn) {
setTimeout(function () {
if (ref.stopped) return;
ref.stop = runProc(fn).stop;
- }, Math.random() * 500);
- }, 400 + Math.random() * 500);
+ }, 1000);
+ }, 1500);
var ref = {};
ref.stop = function () {
@@ -47,29 +47,28 @@ test('reconnection race', function (t) {
up(function (remote) {
remote.beep(function (s) {
results.push(s);
- console.log(s);
});
});
}, 100);
- var mark;
setTimeout(function () {
t.ok(results.length > 10 * 2, 'enough initial events');
- console.log('--- mark ---');
- mark = results.length;
+ clearInterval(iv);
+
+ up(function (remote) {
+ remote.beep(function (s) {
+ t.ok(s);
+ results.push(s);
+ });
+ });
}, 10 * 1000);
- setTimeout(function () {
- t.ok(results.length > mark, 'events have come through');
- console.log('--- stop ---');
- }, 20 * 1000);
-
var server = runProc(createServer);
var hub = runProc(createHub);
t.on('end', function () {
server.stop();
hub.stop();
if (up.close) up.close();
- clearInterval(iv);
+ setTimeout(process.exit, 1000);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.