- if bytes.Compare(buf, TestBlock) != 0 {
- t.Errorf("Got data %+q, expected %+q", buf, TestBlock)
- }
- bufs.Put(buf)
-}
-
-// With trashLifetime = 1ns, perform:
-// Run emptyTrash goroutine
-// Trash an old block - which either raises ErrNotImplemented or succeeds
-// Untrash - after emptyTrash goroutine ticks, and hence does not actually untrash
-// Get - which must fail to find the block
-func testTrashUntrashWithEmptyTrashGoroutine(t TB, factory TestableVolumeFactory) {
- v := factory(t)
- defer v.Teardown()
-
- doneEmptyingTrash := make(chan bool)
- defer func() {
- trashLifetime = 0 * time.Second
- doneEmptyingTrash <- true
- }()
-
- volumes = append(volumes, v)
-
- trashLifetime = 1 * time.Nanosecond
- trashCheckInterval = 1 * time.Nanosecond
-
- go emptyTrash(doneEmptyingTrash, trashCheckInterval)