Skip to content

Commit

Permalink
simplify test, remove waitgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
gbbr committed Feb 9, 2021
1 parent 7bee10d commit 1b5ff56
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions statsd/pipe_windows_test.go
Expand Up @@ -6,7 +6,6 @@ import (
"io/ioutil"
"log"
"os"
"sync"
"testing"

"github.com/Microsoft/go-winio"
Expand All @@ -27,10 +26,7 @@ func TestPipeWriter(t *testing.T) {
log.Fatal(err)
}
out := make(chan string)
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
conn, err := ln.Accept()
if err != nil {
log.Fatal(err)
Expand All @@ -40,8 +36,8 @@ func TestPipeWriter(t *testing.T) {
if err != nil {
log.Fatal(err)
}
out <- string(buf[:n])
conn.Close()
out <- string(buf[:n])
}()

client, err := New(pipepath)
Expand All @@ -55,5 +51,4 @@ func TestPipeWriter(t *testing.T) {
if exp := "metric:1|g|#key:val"; got != exp {
t.Fatalf("Expected %q, got %q", exp, got)
}
wg.Wait() // wait to close conn and goroutine
}

0 comments on commit 1b5ff56

Please sign in to comment.