mirror of
https://github.com/rclone/rclone.git
synced 2025-01-09 07:48:19 +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
@ -27,15 +27,16 @@ type Test struct {
|
|||||||
//
|
//
|
||||||
// FIXME make bucket based remotes set sub-dir automatically???
|
// FIXME make bucket based remotes set sub-dir automatically???
|
||||||
type Backend struct {
|
type Backend struct {
|
||||||
Backend string // name of the backend directory
|
Backend string // name of the backend directory
|
||||||
Remote string // name of the test remote
|
Remote string // name of the test remote
|
||||||
FastList bool // set to test with -fast-list
|
FastList bool // set to test with -fast-list
|
||||||
Short bool // set to test with -short
|
Short bool // set to test with -short
|
||||||
OneOnly bool // set to run only one backend test at once
|
OneOnly bool // set to run only one backend test at once
|
||||||
MaxFile string // file size limit
|
MaxFile string // file size limit
|
||||||
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
|
||||||
@ -79,16 +80,17 @@ func (b *Backend) MakeRuns(t *Test) (runs []*Run) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
run := &Run{
|
run := &Run{
|
||||||
Remote: b.Remote,
|
Remote: b.Remote,
|
||||||
Backend: b.Backend,
|
Backend: b.Backend,
|
||||||
Path: t.Path,
|
Path: t.Path,
|
||||||
FastList: fastlist,
|
FastList: fastlist,
|
||||||
Short: (b.Short && t.Short),
|
Short: (b.Short && t.Short),
|
||||||
NoRetries: t.NoRetries,
|
NoRetries: t.NoRetries,
|
||||||
OneOnly: b.OneOnly,
|
OneOnly: b.OneOnly,
|
||||||
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
|
||||||
|
@ -35,16 +35,17 @@ var (
|
|||||||
// if retries are needed.
|
// if retries are needed.
|
||||||
type Run struct {
|
type Run struct {
|
||||||
// Config
|
// Config
|
||||||
Remote string // name of the test remote
|
Remote string // name of the test remote
|
||||||
Backend string // name of the backend
|
Backend string // name of the backend
|
||||||
Path string // path to the source directory
|
Path string // path to the source directory
|
||||||
FastList bool // add -fast-list to tests
|
FastList bool // add -fast-list to tests
|
||||||
Short bool // add -short
|
Short bool // add -short
|
||||||
NoRetries bool // don't retry if set
|
NoRetries bool // don't retry if set
|
||||||
OneOnly bool // only run test for this backend at once
|
OneOnly bool // only run test for this backend at once
|
||||||
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