test: close worker pool. limit workers to 2.
This commit is contained in:
parent
091ba49408
commit
fc283caf80
@ -28,7 +28,8 @@ ONE_HASH[0] = 0x01;
|
||||
const network = Network.get('regtest');
|
||||
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
enabled: true,
|
||||
size: 2
|
||||
});
|
||||
|
||||
const blocks = new BlockStore({
|
||||
@ -125,12 +126,14 @@ describe('Chain', function() {
|
||||
await blocks.open();
|
||||
await chain.open();
|
||||
await miner.open();
|
||||
await workers.open();
|
||||
|
||||
miner.addresses.length = 0;
|
||||
miner.addAddress(wallet.getReceive());
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await workers.close();
|
||||
await miner.close();
|
||||
await chain.close();
|
||||
await blocks.close();
|
||||
|
||||
@ -29,6 +29,7 @@ const node = new FullNode({
|
||||
walletAuth: true,
|
||||
memory: true,
|
||||
workers: true,
|
||||
workersSize: 2,
|
||||
plugins: [require('../lib/wallet/plugin')],
|
||||
port: ports.p2p,
|
||||
httpPort: ports.node,
|
||||
|
||||
@ -58,7 +58,8 @@ const vectors = [
|
||||
];
|
||||
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
enabled: true,
|
||||
size: 2
|
||||
});
|
||||
|
||||
const blocks = new BlockStore({
|
||||
@ -108,9 +109,11 @@ describe('Indexer', function() {
|
||||
await miner.open();
|
||||
await txindexer.open();
|
||||
await addrindexer.open();
|
||||
await workers.open();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await workers.close();
|
||||
await blocks.close();
|
||||
await chain.close();
|
||||
await miner.close();
|
||||
@ -826,6 +829,7 @@ describe('Indexer', function() {
|
||||
walletAuth: true,
|
||||
memory: true,
|
||||
workers: true,
|
||||
workersSize: 2,
|
||||
indexTX: true,
|
||||
indexAddress: true,
|
||||
port: ports.p2p,
|
||||
|
||||
@ -33,7 +33,8 @@ const ONE_HASH = Buffer.alloc(32, 0x00);
|
||||
ONE_HASH[0] = 0x01;
|
||||
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
enabled: true,
|
||||
size: 2
|
||||
});
|
||||
|
||||
const blocks = new BlockStore({
|
||||
@ -497,7 +498,8 @@ describe('Mempool', function() {
|
||||
|
||||
describe('Index', function () {
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
enabled: true,
|
||||
size: 2
|
||||
});
|
||||
|
||||
const blocks = new BlockStore({
|
||||
@ -819,7 +821,8 @@ describe('Mempool', function() {
|
||||
|
||||
describe('Mempool persistent cache', function () {
|
||||
const workers = new WorkerPool({
|
||||
enabled: true
|
||||
enabled: true,
|
||||
size: 2
|
||||
});
|
||||
|
||||
const blocks = new BlockStore({
|
||||
|
||||
@ -27,6 +27,7 @@ const node = new FullNode({
|
||||
apiKey: 'foo',
|
||||
network: 'regtest',
|
||||
workers: true,
|
||||
workersSize: 2,
|
||||
plugins: [require('../lib/wallet/plugin')],
|
||||
indexTX: true,
|
||||
indexAddress: true,
|
||||
|
||||
@ -20,6 +20,7 @@ const node = new FullNode({
|
||||
walletAuth: true,
|
||||
memory: true,
|
||||
workers: true,
|
||||
workersSize: 2,
|
||||
plugins: [require('../lib/wallet/plugin')],
|
||||
port: ports.p2p,
|
||||
httpPort: ports.node,
|
||||
|
||||
@ -31,8 +31,11 @@ const KEY2 = 'xprv9s21ZrQH143K3mqiSThzPtWAabQ22Pjp3uSNnZ53A5bQ4udp'
|
||||
const PUBKEY = 'xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhaw'
|
||||
+ 'A7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj';
|
||||
|
||||
const enabled = true;
|
||||
const workers = new WorkerPool({ enabled });
|
||||
const workers = new WorkerPool({
|
||||
enabled: true,
|
||||
size: 2
|
||||
});
|
||||
|
||||
const wdb = new WalletDB({ workers });
|
||||
|
||||
let currentWallet = null;
|
||||
@ -236,10 +239,12 @@ describe('Wallet', function() {
|
||||
|
||||
before(async () => {
|
||||
await wdb.open();
|
||||
await workers.open();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await wdb.close();
|
||||
await workers.close();
|
||||
});
|
||||
|
||||
it('should open walletdb', () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user