mirror of https://github.com/golang/go.git
os/signal: wait for goroutine in TestTerminalSignal
Fixes #28169 Change-Id: I187d9effea56357bbb04d4971d284a52ffae61f8 Reviewed-on: https://go-review.googlesource.com/c/142889 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
1d18f66dc8
commit
dc75744f9c
|
|
@ -22,6 +22,7 @@ import (
|
|||
"os/signal/internal/pty"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
|
|
@ -113,7 +114,11 @@ func TestTerminalSignal(t *testing.T) {
|
|||
const prompt = "prompt> "
|
||||
|
||||
// Read data from master in the background.
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
defer wg.Wait()
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
input := bufio.NewReader(master)
|
||||
var line, handled []byte
|
||||
for {
|
||||
|
|
|
|||
Loading…
Reference in New Issue