+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
package main
import (
handler.unblock = make(chan struct{})
defer close(handler.unblock)
- doneGet := make(chan struct{})
+ doneFunc := make(chan struct{})
go func() {
err := testFunc(ctx, v)
c.Check(err, check.Equals, context.Canceled)
- close(doneGet)
+ close(doneFunc)
}()
timeout := time.After(10 * time.Second)
// Get() is waiting for an s3 operation.
select {
case <-timeout:
- c.Fatal("timed out waiting for Get to call our handler")
- case <-doneGet:
- c.Fatal("Get finished without calling our handler!")
+ c.Fatal("timed out waiting for test func to call our handler")
+ case <-doneFunc:
+ c.Fatal("test func finished without even calling our handler!")
case <-handler.requested:
}
select {
case <-timeout:
c.Fatal("timed out")
- case <-doneGet:
+ case <-doneFunc:
}
}
func (v *TestableS3Volume) PutRaw(loc string, block []byte) {
err := v.bucket.Put(loc, block, "application/octet-stream", s3ACL, s3.Options{})
if err != nil {
- log.Printf("PutRaw: %+v", err)
+ log.Printf("PutRaw: %s: %+v", loc, err)
+ }
+ err = v.bucket.Put("recent/"+loc, nil, "application/octet-stream", s3ACL, s3.Options{})
+ if err != nil {
+ log.Printf("PutRaw: recent/%s: %+v", loc, err)
}
}