From 246c2d18cb5cf7ff7b3952b15e49034f25bc0c4c Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 27 Apr 2018 14:17:30 -0400 Subject: [PATCH] tools: fix TypeError from `test.py --time` Calculated durations are timedelta objects but the FormatTime function is expecting a number in seconds. PR-URL: https://github.com/nodejs/node/pull/20368 Fixes: https://github.com/nodejs/node/issues/20341 Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat --- tools/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index b90d144d5f5981..59bfb9e70b0885 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1745,7 +1745,7 @@ def DoSkip(case): timed_tests.sort(lambda a, b: a.CompareTime(b)) index = 1 for entry in timed_tests[:20]: - t = FormatTime(entry.duration) + t = FormatTime(entry.duration.total_seconds()) sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) index += 1