-
- // Trash worker would not delete block if its Mtime is within defaultTrashLifetime
- // Hence, we will have to bypass it to allow the deletion to succeed.
- if !testData.UseDefaultTrashTime {
- go RunTrashWorker(nil, trashq)
- } else {
- arv, err := arvadosclient.MakeArvadosClient()
- if err != nil {
- log.Fatalf("Error setting up arvados client %s", err.Error())
+ defer trashq.Close()
+
+ if !testData.UseTrashLifeTime {
+ // Trash worker would not delete block if its Mtime is
+ // within trash life time. Back-date the block to
+ // allow the deletion to succeed.
+ for _, v := range vols {
+ v.(*MockVolume).Timestamps[testData.DeleteLocator] = oldBlockTime
+ if testData.DifferentMtimes {
+ oldBlockTime = oldBlockTime.Add(time.Second)
+ }