Skip to content
Snippets Groups Projects
Commit 7c308446 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1037 Coverage: remove logging

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