diff options
author | Colton McCurdy <mccurdyc22@gmail.com> | 2018-11-01 08:01:24 -0400 |
---|---|---|
committer | Colton McCurdy <mccurdyc22@gmail.com> | 2018-11-01 08:01:24 -0400 |
commit | 43d4551b4b6e49af1a1402047b3a81fbcd6a85e9 (patch) | |
tree | bd01a18165fe66e44af23daa77b00c84e4206c4c /plumbing/transport/ssh | |
parent | 50bbba3872116aa3e5a37c316b1fda83a7fac344 (diff) | |
download | go-git-43d4551b4b6e49af1a1402047b3a81fbcd6a85e9.tar.gz |
plumbing: ssh, Fix flaky test TestAdvertisedReferencesNotExists. Fixes #969
Signed-off-by: Colton McCurdy <mccurdyc22@gmail.com>
Diffstat (limited to 'plumbing/transport/ssh')
-rw-r--r-- | plumbing/transport/ssh/upload_pack_test.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plumbing/transport/ssh/upload_pack_test.go b/plumbing/transport/ssh/upload_pack_test.go index 87fd4f5..2685ff0 100644 --- a/plumbing/transport/ssh/upload_pack_test.go +++ b/plumbing/transport/ssh/upload_pack_test.go @@ -10,6 +10,7 @@ import ( "os/exec" "path/filepath" "strings" + "sync" "gopkg.in/src-d/go-git.v4/plumbing/transport" "gopkg.in/src-d/go-git.v4/plumbing/transport/test" @@ -97,13 +98,20 @@ func handlerSSH(s ssh.Session) { io.Copy(stdin, s) }() + var wg sync.WaitGroup + wg.Add(2) + go func() { - defer stderr.Close() + defer wg.Done() io.Copy(s.Stderr(), stderr) }() - defer stdout.Close() - io.Copy(s, stdout) + go func() { + defer wg.Done() + io.Copy(s, stdout) + }() + + wg.Wait() if err := cmd.Wait(); err != nil { return |