test: add ListRetries config parameter to integration tests

Occasionally the b2 tests fail because the integration tests don't
retry hard enough with their new setting of -list-retries 3. Override
this setting to 5 for the b2 tests only.
This commit is contained in:
Nick Craig-Wood 2020-10-25 16:15:41 +00:00
parent cf0bdad5de
commit bed83b0b64
3 changed files with 39 additions and 31 deletions

View File

@ -36,6 +36,7 @@ type Backend struct {
CleanUp bool // when running clean, run cleanup first
Ignore []string // test names to ignore the failure of
Tests []string // paths of tests to run, blank for all
ListRetries int // -list-retries if > 0
}
// includeTest returns true if this backend should be included in this
@ -89,6 +90,7 @@ func (b *Backend) MakeRuns(t *Test) (runs []*Run) {
NoBinary: t.NoBinary,
SizeLimit: int64(maxSize),
Ignore: ignore,
ListRetries: b.ListRetries,
}
if t.AddBackend {
run.Path = path.Join(run.Path, b.Backend)

View File

@ -20,6 +20,7 @@ backends:
- backend: "b2"
remote: "TestB2:"
fastlist: true
listretries: 5
- backend: "crypt"
remote: "TestCryptDrive:"
fastlist: true

View File

@ -45,6 +45,7 @@ type Run struct {
NoBinary bool // set to not build a binary
SizeLimit int64 // maximum test file size
Ignore map[string]struct{}
ListRetries int // -list-retries if > 0
// Internals
CmdLine []string
CmdString string
@ -336,8 +337,12 @@ func (r *Run) Init() {
r.CmdLine = []string{"./" + r.BinaryName()}
}
r.CmdLine = append(r.CmdLine, prefix+"v", prefix+"timeout", timeout.String(), "-remote", r.Remote)
if *listRetries > 0 {
r.CmdLine = append(r.CmdLine, "-list-retries", fmt.Sprint(*listRetries))
listRetries := *listRetries
if r.ListRetries > 0 {
listRetries = r.ListRetries
}
if listRetries > 0 {
r.CmdLine = append(r.CmdLine, "-list-retries", fmt.Sprint(listRetries))
}
r.Try = 1
if *verbose {