mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-12 06:44:37 +00:00
Fix failing test on blockchain
This commit is contained in:
parent
6abbcad243
commit
21da13ab69
@ -88,12 +88,21 @@ Blockchain.prototype.setupProxy = function() {
|
|||||||
|
|
||||||
let ipcObject = new Ipc({ipcRole: 'client'});
|
let ipcObject = new Ipc({ipcRole: 'client'});
|
||||||
|
|
||||||
proxy.serve(ipcObject, this.config.rpcHost, this.config.rpcPort, false);
|
this.rpcProxy = proxy.serve(ipcObject, this.config.rpcHost, this.config.rpcPort, false);
|
||||||
proxy.serve(ipcObject, this.config.wsHost, this.config.wsPort, true);
|
this.wsProxy = proxy.serve(ipcObject, this.config.wsHost, this.config.wsPort, true);
|
||||||
this.config.rpcPort += constants.blockchain.servicePortOnProxy;
|
this.config.rpcPort += constants.blockchain.servicePortOnProxy;
|
||||||
this.config.wsPort += constants.blockchain.servicePortOnProxy;
|
this.config.wsPort += constants.blockchain.servicePortOnProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Blockchain.prototype.shutdownProxy = function() {
|
||||||
|
if (!this.config.proxy) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.rpcProxy.close();
|
||||||
|
this.wsProxy.close();
|
||||||
|
}
|
||||||
|
|
||||||
Blockchain.prototype.runCommand = function(cmd, options, callback) {
|
Blockchain.prototype.runCommand = function(cmd, options, callback) {
|
||||||
console.log(__("running: %s", cmd.underline).green);
|
console.log(__("running: %s", cmd.underline).green);
|
||||||
if (this.blockchainConfig.silent) {
|
if (this.blockchainConfig.silent) {
|
||||||
@ -204,6 +213,8 @@ Blockchain.prototype.readyCallback = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Blockchain.prototype.kill = function() {
|
Blockchain.prototype.kill = function() {
|
||||||
|
this.shutdownProxy();
|
||||||
|
|
||||||
if (this.child) {
|
if (this.child) {
|
||||||
this.child.kill();
|
this.child.kill();
|
||||||
}
|
}
|
||||||
|
@ -121,4 +121,5 @@ exports.serve = function(ipc, host, port, ws){
|
|||||||
}
|
}
|
||||||
|
|
||||||
server.listen(port);
|
server.listen(port);
|
||||||
|
return server;
|
||||||
};
|
};
|
||||||
|
@ -50,6 +50,7 @@ describe('embark.Blockchain', function () {
|
|||||||
config.rpcPort += constants.blockchain.servicePortOnProxy;
|
config.rpcPort += constants.blockchain.servicePortOnProxy;
|
||||||
}
|
}
|
||||||
assert.deepEqual(blockchain.config, config);
|
assert.deepEqual(blockchain.config, config);
|
||||||
|
blockchain.kill();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -94,6 +95,7 @@ describe('embark.Blockchain', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert.deepEqual(blockchain.config, config);
|
assert.deepEqual(blockchain.config, config);
|
||||||
|
blockchain.kill();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*global describe, it, before, beforeEach*/
|
/*global describe, it, before, beforeEach*/
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const sinon = require('sinon');
|
const sinon = require('sinon');
|
||||||
const TestLogger = require('../lib/tests/test_logger.js');
|
const TestLogger = require('../lib/tests/test_logger');
|
||||||
const ProcessLauncher = require('../lib/process/processLauncher');
|
const ProcessLauncher = require('../lib/process/processLauncher');
|
||||||
|
|
||||||
describe('ProcessWrapper', () => {
|
describe('ProcessWrapper', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user