We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24ff884 commit 8b88538Copy full SHA for 8b88538
internal/provider/git_test.go
@@ -125,21 +125,24 @@ func startSSHServer(ctx context.Context, t testing.TB) string {
125
t.Logf("command failed: %s", err)
126
return
127
}
128
- t.Cleanup(func() {
129
- _ = in.Close()
130
- _ = out.Close()
131
- _ = cmd.Process.Kill()
132
- })
133
134
go func() {
135
_, _ = io.Copy(in, s)
136
_ = in.Close()
137
}()
+ outDone := make(chan struct{})
138
+ defer close(outDone)
139
_, _ = io.Copy(s, out)
140
_ = out.Close()
141
_ = s.CloseWrite()
142
+ t.Cleanup(func() {
+ _ = in.Close()
+ _ = out.Close()
143
+ <-outDone
144
+ _ = cmd.Process.Kill()
145
+ })
146
err = cmd.Wait()
147
if err != nil {
148
0 commit comments