From c54ea05e27c1050a1f6c41f1bfe6ce13d0924b9a Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Tue, 7 Nov 2023 10:43:19 -0800 Subject: [PATCH] pr comments --- e2etests-cli/main_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/e2etests-cli/main_test.go b/e2etests-cli/main_test.go index 647b6722e..272457eb3 100644 --- a/e2etests-cli/main_test.go +++ b/e2etests-cli/main_test.go @@ -578,7 +578,7 @@ layers: { watchURL := waitLogs(ctx, stderr, urlRE) if watchURL == "" { - t.Error(errors.New(string(stderr.Bytes()))) + t.Error(errors.New(stderr.String())) } stderr.Reset() @@ -634,7 +634,7 @@ layers: { watchURL := waitLogs(ctx, stderr, urlRE) if watchURL == "" { - t.Error(errors.New(string(stderr.Bytes()))) + t.Error(errors.New(stderr.String())) } stderr.Reset() @@ -688,7 +688,7 @@ layers: { watchURL := waitLogs(ctx, stderr, urlRE) if watchURL == "" { - t.Error(errors.New(string(stderr.Bytes()))) + t.Error(errors.New(stderr.String())) } stderr.Reset() @@ -812,11 +812,12 @@ func getNumBoards(svg string) int { func waitLogs(ctx context.Context, buf *bytes.Buffer, pattern *regexp.Regexp) string { ticker := time.NewTicker(10 * time.Millisecond) + defer ticker.Stop() var match string for i := 0; i < 100 && match == ""; i++ { select { case <-ticker.C: - out := string(buf.Bytes()) + out := buf.String() match = pattern.FindString(out) case <-ctx.Done(): ticker.Stop()