Commit 7c308446 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1037 Coverage: remove logging

parent ed695f4a
......@@ -54,7 +54,7 @@ export class Master {
// Stop the slaves' current work
this.cancelWork()
}
this.logger.warn(`ENGINE c#${this.clusterId}#${this.slavesMap[worker.id].index}:`, message)
// this.logger.debug(`ENGINE c#${this.clusterId}#${this.slavesMap[worker.id].index}:`, message)
}
initCluster() {
......@@ -175,9 +175,7 @@ export class Master {
this.currentPromise = this.newPromise(uuid)
return (async () => {
this.logger.info(`Waiting workers to be all online...`)
await Promise.all(this.workersOnline)
this.logger.info(`All online!`)
if (!this.currentPromise) {
this.logger.info(`Proof canceled during workers' initialization`)
......@@ -185,9 +183,7 @@ export class Master {
}
// Start the salves' job
this.logger.info(`Sending newPow signal for each of %s workers...`, this.slaves.length)
this.slaves.forEach((s:any, index) => {
this.logger.info(`Sending signal for worker #%s`, index)
s.worker.send({
uuid,
command: 'newPoW',
......
......@@ -34,7 +34,6 @@ process.on('uncaughtException', (err:any) => {
process.on('message', async (message) => {
console.log('proof => command:', message.command)
switch (message.command) {
case 'newPoW':
......@@ -42,15 +41,11 @@ process.on('message', async (message) => {
askedStop = true
// Very important: do not await if the computation is already done, to keep the lock on JS engine
console.log('computing.isFulfilled ?', computing.isFulfilled())
if (!computing.isFulfilled()) {
await computing;
}
console.log('beginNewProofOfWork()...')
const res = await beginNewProofOfWork(message.value);
console.log('proof.res!')
answer(message, res);
})()
break;
......
const toolbox = require('./tools/toolbox')
const logger = require('../../app/lib/logger').NewLogger()
describe("Membership chainability", function() {
......@@ -19,20 +18,14 @@ describe("Membership chainability", function() {
}
before(async () => {
require('../../app/lib/logger').NewLogger().unmute()
logger.warn('Before() ...')
const res1 = await toolbox.simpleNodeWith2Users(conf)
logger.warn('res1 = OK')
s1 = res1.s1
cat = res1.cat
await s1.commit({ time: now })
logger.warn('commit1 = OK')
await s1.commit({ time: now })
logger.warn('commit2 = OK')
await s1.commit({ time: now, actives: [
'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd:rppB5NEwmdMUCxw3N/QPMk+V1h2Jpn0yxTzdO2xxcNN3MACv6x8vNTChWwM6DOq+kXiQHTczFzoux+82WkMfDQ==:1-12D7B9BEBE941F6929A4A61CDC06DEEEFCB00FD1DA72E42FFF7B19A338D421E1:0-E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855:cat'
]})
logger.warn('commit3 = OK')
})
it('current should be the 2nd', () => s1.expect('/blockchain/current', (res:any) => {
......@@ -61,18 +54,11 @@ describe("Membership chainability", function() {
}
before(async () => {
require('../../app/lib/logger').NewLogger().unmute()
logger.warn('before2')
const res1 = await toolbox.simpleNodeWith2Users(conf)
logger.warn('res2 = OK')
s1 = res1.s1
logger.warn('res2 = OK1')
cat = res1.cat
logger.warn('res2 = OK2')
await s1.commit({ time: now })
logger.warn('commit2.0 = OK')
await s1.commit({ time: now + 20 })
logger.warn('commit2.1 = OK')
})
it('should refuse a block with a too early membership in it', async () => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment