Skip to content

Commit 9876f54

Browse files
Eric LeeseDevtools-frontend LUCI CQ
authored andcommitted
Always round test duration to milliseconds
Bug: 408145209 Change-Id: I7246d08a8ff033c081a141b49ded7070f977ddd6 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6429854 Commit-Queue: Eric Leese <[email protected]> Reviewed-by: Philip Pfaffe <[email protected]> Reviewed-by: Liviu Rau <[email protected]>
1 parent c71b0b4 commit 9876f54

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/conductor/karma-resultsdb-reporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const ResultsDBReporter = function(
6767
const status = skipped ? 'SKIP' : success ? 'PASS' : 'FAIL';
6868
let duration = '.001s';
6969
if (startTime < endTime) {
70-
duration = ((endTime - startTime) * .001).toString() + 's';
70+
duration = ((endTime - startTime) * .001).toFixed(3) + 's';
7171
}
7272

7373
const consoleLog = capturedLog.map(({type, log}) => `${type.toUpperCase()}: ${log}`);

test/shared/mocha-resultsdb-reporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class ResultsDbReporter extends Mocha.reporters.Spec {
134134
const testRetry = ((test as unknown) as TestRetry);
135135
const result = {
136136
testId: ResultsDb.sanitizedTestId(testId),
137-
duration: `${(test.duration || 0) * .001}s`,
137+
duration: `${((test.duration || 1) * .001).toFixed(3)}s`,
138138
tags: [{key: 'run', value: String(testRetry.currentRetry() + 1)}],
139139
};
140140
const hookName = this.maybeHook(test);

0 commit comments

Comments
 (0)