@hyperledger/caliper-core
Advanced tools
Comparing version 0.3.1-unstable-20200402150534 to 0.3.1-unstable-20200403093101
@@ -91,3 +91,3 @@ /* | ||
context.messenger.send(['orchestrator'], type, {error: error.toString()}); | ||
logger.error(`Handled unsuccessful "init" message for worker ${context.workerId}, with error: ${error.toString()}`); | ||
logger.error(`Handled unsuccessful "init" message for worker ${context.workerId}, with error: ${error.stack}`); | ||
} else { | ||
@@ -121,3 +121,3 @@ context.workerClient = new CaliperLocalClient(context.adapter, context.workerId, context.messenger); | ||
context.messenger.send(['orchestrator'], type, {error: error.toString()}); | ||
logger.error(`Handled unsuccessful "prepare" message for worker ${context.workerId} and test round ${message.testRound} with error ${error.toString()}`); | ||
logger.error(`Handled unsuccessful "prepare" message for worker ${context.workerId} and test round ${message.testRound} with error ${error.stack}`); | ||
} else { | ||
@@ -144,8 +144,15 @@ context.messenger.send(['orchestrator'], type, {}); | ||
* @param {object} message The message object. | ||
* @param {object} error An error conditioning message | ||
*/ | ||
static async afterTest(context, message) { | ||
await CaliperUtils.sleep(200); | ||
static async afterTest(context, message, error) { | ||
const type = 'testResult'; | ||
context.messenger.send(['orchestrator'], type, context.testResult); | ||
logger.info(`Handled "test" message for worker ${context.workerId}`); | ||
if (error) { | ||
// send(to, type, data) | ||
context.messenger.send(['orchestrator'], type, {error: error.toString()}); | ||
logger.error(`Handled unsuccessful "test" message for worker ${context.workerId} and test round ${message.testRound} with error ${error.stack}`); | ||
} else { | ||
context.messenger.send(['orchestrator'], type, context.testResult); | ||
logger.info(`Handled successful "test" message for worker ${context.workerId} and test round ${message.testRound}`); | ||
} | ||
} | ||
@@ -222,5 +229,9 @@ | ||
case 'test': { | ||
await context.beforeTestHandler(context, message); | ||
context.testResult = await context.testHandler(context, message); | ||
await context.afterTestHandler(context, message); | ||
try { | ||
await context.beforeTestHandler(context, message); | ||
context.testResult = await context.testHandler(context, message); | ||
await context.afterTestHandler(context, message, undefined); | ||
} catch (err) { | ||
await context.afterTestHandler(context, message, err); | ||
} | ||
@@ -227,0 +238,0 @@ break; |
{ | ||
"name": "@hyperledger/caliper-core", | ||
"description": "Core Hyperledger Caliper module, used for running performance benchmarks that interact with blockchain technologies", | ||
"version": "0.3.1-unstable-20200402150534", | ||
"version": "0.3.1-unstable-20200403093101", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
464419
10372