NoCloseClone returns a new test bucket referencing the same underlying bucket and bucketspec, but with an IgnoreClose leaky bucket, and a no-op close function. Used when multiple references to the same bucket are needed.
()
| 92 | // NoCloseClone returns a new test bucket referencing the same underlying bucket and bucketspec, but |
| 93 | // with an IgnoreClose leaky bucket, and a no-op close function. Used when multiple references to the same bucket are needed. |
| 94 | func (tb *TestBucket) NoCloseClone() *TestBucket { |
| 95 | return &TestBucket{ |
| 96 | Bucket: NoCloseClone(tb.Bucket), |
| 97 | BucketSpec: tb.BucketSpec, |
| 98 | closeFn: func(context.Context) {}, |
| 99 | t: tb.t, |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | // GetTestBucket returns a test bucket from a pool. |
| 104 | func GetTestBucket(t testing.TB) *TestBucket { |