Commit dc75744f authored by Ian Lance Taylor's avatar Ian Lance Taylor

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 1d18f66d
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"os/signal/internal/pty" "os/signal/internal/pty"
"strconv" "strconv"
"strings" "strings"
"sync"
"syscall" "syscall"
"testing" "testing"
"time" "time"
...@@ -113,7 +114,11 @@ func TestTerminalSignal(t *testing.T) { ...@@ -113,7 +114,11 @@ func TestTerminalSignal(t *testing.T) {
const prompt = "prompt> " const prompt = "prompt> "
// Read data from master in the background. // Read data from master in the background.
var wg sync.WaitGroup
wg.Add(1)
defer wg.Wait()
go func() { go func() {
defer wg.Done()
input := bufio.NewReader(master) input := bufio.NewReader(master)
var line, handled []byte var line, handled []byte
for { for {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment