test: proxy engine edge cases + storage/server minio retry
Cover denied, HEAD (cached/uncached/denied), stale-on-error, circuit-open, and mutable revalidation (304) paths. proxy ~8->58%.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.unkin.net/unkin/artifactapi/internal/testsupport"
|
||||
)
|
||||
@@ -19,7 +20,13 @@ func TestMain(m *testing.M) {
|
||||
if err != nil {
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
s3, err := NewS3(conn.Endpoint, conn.AccessKey, conn.SecretKey, "test-bucket", false, "")
|
||||
var s3 *S3
|
||||
for i := 0; i < 20; i++ { // MinIO can report ready before bucket ops succeed
|
||||
if s3, err = NewS3(conn.Endpoint, conn.AccessKey, conn.SecretKey, "test-bucket", false, ""); err == nil {
|
||||
break
|
||||
}
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
if err != nil {
|
||||
terminate()
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user