From 6e38d2948589df598a7f1f58e013f5eca2103260 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 11 Sep 2020 16:26:05 -0700 Subject: [PATCH] wgengine/magicsock: improve test logging output This fixes line numbers and reduces timestamp precision to overwhelming the output. Signed-off-by: Josh Bleecher Snyder --- wgengine/magicsock/magicsock_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index d2ce76459..7530861b2 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -783,7 +783,8 @@ func testActiveDiscovery(t *testing.T, d *devices) { start := time.Now() logf := func(msg string, args ...interface{}) { - msg = fmt.Sprintf("%s: %s", time.Since(start), msg) + t.Helper() + msg = fmt.Sprintf("%s: %s", time.Since(start).Truncate(time.Microsecond), msg) tlogf(msg, args...) }