@@ -50,8 +50,14 @@ func create(t *testing.T, ptty pty.PTY, name string) *PTY {
50
50
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitShort )
51
51
defer cancel ()
52
52
53
+ logf (t , name , "close logw on cleanup" )
53
54
_ = logw .Close ()
55
+
56
+ logf (t , name , "close logr on cleanup" )
54
57
_ = logr .Close ()
58
+
59
+ logf (t , name , "logr and logw closed" )
60
+
55
61
select {
56
62
case <- ctx .Done ():
57
63
fatalf (t , name , "cleanup" , "log pipe did not close in time" )
@@ -74,6 +80,7 @@ func create(t *testing.T, ptty pty.PTY, name string) *PTY {
74
80
75
81
// Close pty only so that the copy goroutine can consume the
76
82
// remainder of it's buffer and then exit.
83
+ logf (t , name , "close pty on cleanup" )
77
84
err := ptty .Close ()
78
85
// Pty may already be closed, so don't fail the test, but log
79
86
// the error in case it's significant.
@@ -152,7 +159,7 @@ func (p *PTY) ExpectMatch(str string) string {
152
159
p .logf ("matched %q = %q" , str , buffer .String ())
153
160
return buffer .String ()
154
161
case <- timeout .Done ():
155
- // Ensure gorouine is cleaned up before test exit.
162
+ // Ensure goroutine is cleaned up before test exit.
156
163
_ = p .out .closeErr (p .Close ())
157
164
<- match
158
165
0 commit comments