From 65d35f8e7d7aa1bc744619c1c813133661b4dfae Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 28 Jun 2022 00:15:05 +0000 Subject: [PATCH] Report javascript duration in CTS tooling Always report the Javascript duration from the page instead of the total duration from ResultDB. Reporting of the total duration could be added back in the future, but usages of the tooling are currently interested in the Javascript duration. Bug: chromium:1336333 Change-Id: I74e91e7a9c29f3a4c45ed67898cc6f2de62e19a4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94762 Reviewed-by: Ben Clayton Commit-Queue: Austin Eng --- tools/src/cmd/cts/common/results.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/src/cmd/cts/common/results.go b/tools/src/cmd/cts/common/results.go index 934195ef8c..da761471b9 100644 --- a/tools/src/cmd/cts/common/results.go +++ b/tools/src/cmd/cts/common/results.go @@ -218,13 +218,20 @@ func GetResults( status := toStatus(rpb.Status) tags := result.NewTags() + duration := rpb.GetDuration().AsDuration() + for _, sp := range rpb.Tags { if sp.Key == "typ_tag" { tags.Add(sp.Value) } + if sp.Key == "javascript_duration" { + var err error + if duration, err = time.ParseDuration(sp.Value); err != nil { + return err + } + } } - duration := rpb.GetDuration().AsDuration() if status == result.Pass && duration > cfg.Test.SlowThreshold { status = result.Slow }