Skip to content

Commit 8e44e7e

Browse files
committed
test: adjust getwork timeouts.
1 parent a6c3265 commit 8e44e7e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/getwork-test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ const {wdb} = node.require('walletdb');
2222

2323
let wallet = null;
2424

25+
const TIMEOUT = 45000;
26+
2527
describe('Get Work', function() {
26-
this.timeout(45000);
28+
this.timeout(TIMEOUT);
2729

2830
it('should open chain and miner', async () => {
2931
await node.open();
@@ -36,13 +38,15 @@ describe('Get Work', function() {
3638
});
3739

3840
it('should mine 10 blocks', async () => {
39-
const connectEvents = forEvent(chain, 'connect', 10, 10000);
41+
const DELAY = 500;
42+
const waits = DELAY * 10;
43+
const connectEvents = forEvent(chain, 'connect', 10, TIMEOUT - waits);
4044
for (let i = 0; i < 10; i++) {
4145
const block = await miner.mineBlock();
4246
assert(block);
4347
await chain.add(block);
4448
// lower mtp.
45-
await sleep(500);
49+
await sleep(DELAY);
4650
}
4751

4852
await connectEvents;

0 commit comments

Comments
 (0)