Skip to content

Commit 336c2f1

Browse files
committed
make tests more robust on slow machine
1 parent 02db04a commit 336c2f1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/test.main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ describe('main', function () {
993993
app.migrate([{ up : _testSchema, down : ''}]);
994994

995995
const _numPatches = 100000;
996-
const _threshold = 100; // ms
996+
const _threshold = 150; // ms
997997
const _patches = [];
998998
const _peerCount = 10;
999999
// Create patches
@@ -1486,15 +1486,16 @@ describe('main', function () {
14861486
}, (success) => {
14871487
assert.strictEqual(success, true);
14881488
// Verify the backoff timing - should start at 0 and increase exponentially with some tolerance
1489-
const _expectedDelays = [0, 10, 20];
1489+
const _expectedDelays = [0, 20, 40];
14901490
for (let i = 0; i < _nbCalls.length; i++) {
14911491
const _actual = _nbCalls[i];
14921492
const _expected = _expectedDelays[i];
1493+
console.log(`Call ${i}: expected ~${_expected}ms, got ${_actual}ms (tolerance: 20ms)` );
14931494
assert.ok(Math.abs(_actual - _expected) <= 20, `Call ${i}: expected ~${_expected}ms, got ${_actual}ms (tolerance: 20ms)` );
14941495
}
14951496
assert.strictEqual(_nbCalls.length, 3, 'Should have called the function 3 times');
14961497
done();
1497-
}, 2000, 10);
1498+
}, 2000, 20);
14981499
});
14991500

15001501
});

0 commit comments

Comments
 (0)