mirror of
https://github.com/rclone/rclone.git
synced 2025-01-09 15:58:28 +01:00
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:
parent
cf0bdad5de
commit
bed83b0b64
@ -36,6 +36,7 @@ type Backend struct {
|
|||||||
CleanUp bool // when running clean, run cleanup first
|
CleanUp bool // when running clean, run cleanup first
|
||||||
Ignore []string // test names to ignore the failure of
|
Ignore []string // test names to ignore the failure of
|
||||||
Tests []string // paths of tests to run, blank for all
|
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
|
// 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,
|
NoBinary: t.NoBinary,
|
||||||
SizeLimit: int64(maxSize),
|
SizeLimit: int64(maxSize),
|
||||||
Ignore: ignore,
|
Ignore: ignore,
|
||||||
|
ListRetries: b.ListRetries,
|
||||||
}
|
}
|
||||||
if t.AddBackend {
|
if t.AddBackend {
|
||||||
run.Path = path.Join(run.Path, b.Backend)
|
run.Path = path.Join(run.Path, b.Backend)
|
||||||
|
@ -20,6 +20,7 @@ backends:
|
|||||||
- backend: "b2"
|
- backend: "b2"
|
||||||
remote: "TestB2:"
|
remote: "TestB2:"
|
||||||
fastlist: true
|
fastlist: true
|
||||||
|
listretries: 5
|
||||||
- backend: "crypt"
|
- backend: "crypt"
|
||||||
remote: "TestCryptDrive:"
|
remote: "TestCryptDrive:"
|
||||||
fastlist: true
|
fastlist: true
|
||||||
|
@ -45,6 +45,7 @@ type Run struct {
|
|||||||
NoBinary bool // set to not build a binary
|
NoBinary bool // set to not build a binary
|
||||||
SizeLimit int64 // maximum test file size
|
SizeLimit int64 // maximum test file size
|
||||||
Ignore map[string]struct{}
|
Ignore map[string]struct{}
|
||||||
|
ListRetries int // -list-retries if > 0
|
||||||
// Internals
|
// Internals
|
||||||
CmdLine []string
|
CmdLine []string
|
||||||
CmdString string
|
CmdString string
|
||||||
@ -336,8 +337,12 @@ func (r *Run) Init() {
|
|||||||
r.CmdLine = []string{"./" + r.BinaryName()}
|
r.CmdLine = []string{"./" + r.BinaryName()}
|
||||||
}
|
}
|
||||||
r.CmdLine = append(r.CmdLine, prefix+"v", prefix+"timeout", timeout.String(), "-remote", r.Remote)
|
r.CmdLine = append(r.CmdLine, prefix+"v", prefix+"timeout", timeout.String(), "-remote", r.Remote)
|
||||||
if *listRetries > 0 {
|
listRetries := *listRetries
|
||||||
r.CmdLine = append(r.CmdLine, "-list-retries", fmt.Sprint(*listRetries))
|
if r.ListRetries > 0 {
|
||||||
|
listRetries = r.ListRetries
|
||||||
|
}
|
||||||
|
if listRetries > 0 {
|
||||||
|
r.CmdLine = append(r.CmdLine, "-list-retries", fmt.Sprint(listRetries))
|
||||||
}
|
}
|
||||||
r.Try = 1
|
r.Try = 1
|
||||||
if *verbose {
|
if *verbose {
|
||||||
|
Loading…
Reference in New Issue
Block a user