Skip to content

Commit

Permalink
test: adjust getwork timeouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
nodech committed Sep 24, 2023
1 parent a6c3265 commit 8e44e7e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/getwork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const {wdb} = node.require('walletdb');

let wallet = null;

const TIMEOUT = 45000;

describe('Get Work', function() {
this.timeout(45000);
this.timeout(TIMEOUT);

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

it('should mine 10 blocks', async () => {
const connectEvents = forEvent(chain, 'connect', 10, 10000);
const DELAY = 500;
const waits = DELAY * 10;
const connectEvents = forEvent(chain, 'connect', 10, TIMEOUT - waits);
for (let i = 0; i < 10; i++) {
const block = await miner.mineBlock();
assert(block);
await chain.add(block);
// lower mtp.
await sleep(500);
await sleep(DELAY);
}

await connectEvents;
Expand Down

0 comments on commit 8e44e7e

Please sign in to comment.