From db0cd1d106849eb8e70c922f7d568bcf8346bb7a Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 13 May 2024 17:32:14 -0700 Subject: [PATCH] make wallTime mandatory --- packages/trace-viewer/src/ui/callTab.tsx | 7 ++----- packages/trace-viewer/src/ui/logTab.tsx | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/trace-viewer/src/ui/callTab.tsx b/packages/trace-viewer/src/ui/callTab.tsx index 8e56fabb7d..b7cd7a8581 100644 --- a/packages/trace-viewer/src/ui/callTab.tsx +++ b/packages/trace-viewer/src/ui/callTab.tsx @@ -35,11 +35,8 @@ export const CallTab: React.FunctionComponent<{ // Strip down the waitForEventInfo data, we never need it. delete params.info; const paramKeys = Object.keys(params); - let wallTime = null; - if (action.context.wallTime) { - const timeMillis = action.startTime + (action.context.wallTime - action.context.startTime); - wallTime = new Date(timeMillis).toLocaleString(); - } + const timeMillis = action.startTime + (action.context.wallTime - action.context.startTime); + const wallTime = new Date(timeMillis).toLocaleString(); const duration = action.endTime ? msToString(action.endTime - action.startTime) : 'Timed Out'; return
diff --git a/packages/trace-viewer/src/ui/logTab.tsx b/packages/trace-viewer/src/ui/logTab.tsx index be189ad314..be0469ab91 100644 --- a/packages/trace-viewer/src/ui/logTab.tsx +++ b/packages/trace-viewer/src/ui/logTab.tsx @@ -31,8 +31,7 @@ export const LogTab: React.FunctionComponent<{ if (!action || !action.log.length) return []; const log = action.log; - // TODO: store context metadata for test runner context. - const wallTimeOffset = (action.context.wallTime || action.context.startTime) - action.context.startTime; + const wallTimeOffset = action.context.wallTime - action.context.startTime; const entries: { message: string, time: string }[] = []; for (let i = 0; i < log.length; ++i) { let time = '';