chore: add debug logging to localize steps error (#8062)

This commit is contained in:
Pavel Feldman 2021-08-06 20:37:57 -07:00 committed by GitHub
parent 3424f59e67
commit b1dc84c953
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -253,7 +253,11 @@ export class Dispatcher {
});
worker.on('stepEnd', (params: StepEndPayload) => {
const { test, result, steps } = this._testById.get(params.testId)!;
const step = steps.get(params.stepId)!;
const step = steps.get(params.stepId);
if (!step) {
this._reporter.onStdErr?.('Internal error: step end without step begin: ' + params.stepId, test, result);
return;
}
step.duration = params.wallTime - step.startTime.getTime();
if (params.error)
step.error = params.error;

View file

@ -273,7 +273,7 @@ export class WorkerRunner extends EventEmitter {
},
_testFinished: new Promise(f => testFinishedCallback = f),
_addStep: (category: string, title: string) => {
const stepId = `${category}@${++lastStepId}`;
const stepId = `${category}@${title}@${++lastStepId}`;
const payload: StepBeginPayload = {
testId,
stepId,