MCPcopy Create free account
hub / github.com/coder/coder / Cleanup

Method Cleanup

scaletest/harness/run.go:128–151  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

126}
127
128func (r *TestRun) Cleanup(ctx context.Context) (err error) {
129 c, ok := r.runner.(Cleanable)
130 if !ok {
131 return nil
132 }
133
134 select {
135 case <-r.done:
136 default:
137 // Test wasn't executed, so we don't need to clean up.
138 return nil
139 }
140
141 defer func() {
142 e := recover()
143 if e != nil {
144 err = xerrors.Errorf("panic: %v", e)
145 }
146 }()
147
148 err = c.Cleanup(ctx, r.id, r.logs)
149 //nolint:revive // we use named returns because we mutate it in a defer
150 return
151}
152
153type syncBuffer struct {
154 buf *bytes.Buffer

Callers 1

Test_TestRunFunction · 0.95

Calls 2

CleanupMethod · 0.65
ErrorfMethod · 0.45

Tested by 1

Test_TestRunFunction · 0.76