MCPcopy Index your code
hub / github.com/coder/coder / Close

Method Close

testutil/expecter/expecter.go:116–140  ·  view source on GitHub ↗
(reason string)

Source from the content-addressed store, hash-verified

114}
115
116func (e *Expecter) Close(reason string) {
117 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
118 defer cancel()
119
120 e.Logf("closing expecter: %s", reason)
121
122 // Caller needs to have closed the stream so that copying can complete
123 select {
124 case <-ctx.Done():
125 e.fatalf("close", "copy did not close in time")
126 return
127 case <-e.copyDone:
128 }
129
130 e.logClose("logw", e.logw)
131 e.logClose("logr", e.logr)
132 select {
133 case <-ctx.Done():
134 e.fatalf("close", "log pipe did not close in time")
135 return
136 case <-e.logDone:
137 }
138
139 e.Logf("closed expecter")
140}
141
142func (e *Expecter) logClose(name string, c io.Closer) {
143 e.Logf("closing %s", name)

Callers

nothing calls this directly

Calls 4

LogfMethod · 0.95
fatalfMethod · 0.95
logCloseMethod · 0.95
DoneMethod · 0.45

Tested by

no test coverage detected