From 1c9a66950c53f0f01546b30814a5ae6693ea8c37 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Mon, 25 Nov 2019 23:40:02 -0800 Subject: [PATCH] client: fix use of T.Fatal inside TestFS_logsImpl_NoFollow() goroutine. --- client/fs_endpoint_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/client/fs_endpoint_test.go b/client/fs_endpoint_test.go index 40a9b451d84..f6f28422f60 100644 --- a/client/fs_endpoint_test.go +++ b/client/fs_endpoint_test.go @@ -1884,13 +1884,14 @@ func TestFS_logsImpl_NoFollow(t *testing.T) { }() // Start streaming logs - go func() { - if err := c.endpoints.FileSystem.logsImpl( - context.Background(), false, false, 0, - OriginStart, task, logType, ad, frames); err != nil { - t.Fatalf("logs() failed: %v", err) - } - }() + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + + if err := c.endpoints.FileSystem.logsImpl( + ctx, false, false, 0, + OriginStart, task, logType, ad, frames); err != nil { + t.Fatalf("logsImpl failed: %v", err) + } select { case <-resultCh: