mirror of
https://github.com/rclone/rclone.git
synced 2025-01-20 16:28:46 +08:00
test_all: allow configuring a multiplier for the timeout #5734
This commit is contained in:
parent
72c013c6f4
commit
ff801e8e17
|
@ -37,6 +37,7 @@ type Backend struct {
|
||||||
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
|
ListRetries int // -list-retries if > 0
|
||||||
|
ExtraTime float64 // factor to multiply the timeout by
|
||||||
}
|
}
|
||||||
|
|
||||||
// includeTest returns true if this backend should be included in this
|
// includeTest returns true if this backend should be included in this
|
||||||
|
@ -91,6 +92,7 @@ func (b *Backend) MakeRuns(t *Test) (runs []*Run) {
|
||||||
SizeLimit: int64(maxSize),
|
SizeLimit: int64(maxSize),
|
||||||
Ignore: ignore,
|
Ignore: ignore,
|
||||||
ListRetries: b.ListRetries,
|
ListRetries: b.ListRetries,
|
||||||
|
ExtraTime: b.ExtraTime,
|
||||||
}
|
}
|
||||||
if t.AddBackend {
|
if t.AddBackend {
|
||||||
run.Path = path.Join(run.Path, b.Backend)
|
run.Path = path.Join(run.Path, b.Backend)
|
||||||
|
|
|
@ -47,6 +47,7 @@ type Run struct {
|
||||||
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
|
ListRetries int // -list-retries if > 0
|
||||||
|
ExtraTime float64 // multiply the timeout by this
|
||||||
// Internals
|
// Internals
|
||||||
CmdLine []string
|
CmdLine []string
|
||||||
CmdString string
|
CmdString string
|
||||||
|
@ -337,7 +338,12 @@ func (r *Run) Init() {
|
||||||
} else {
|
} else {
|
||||||
r.CmdLine = []string{"./" + r.BinaryName()}
|
r.CmdLine = []string{"./" + r.BinaryName()}
|
||||||
}
|
}
|
||||||
r.CmdLine = append(r.CmdLine, prefix+"v", prefix+"timeout", timeout.String(), "-remote", r.Remote)
|
testTimeout := *timeout
|
||||||
|
log.Printf("extra time: %f", r.ExtraTime)
|
||||||
|
if r.ExtraTime > 0 {
|
||||||
|
testTimeout = time.Duration(float64(testTimeout) * r.ExtraTime)
|
||||||
|
}
|
||||||
|
r.CmdLine = append(r.CmdLine, prefix+"v", prefix+"timeout", testTimeout.String(), "-remote", r.Remote)
|
||||||
listRetries := *listRetries
|
listRetries := *listRetries
|
||||||
if r.ListRetries > 0 {
|
if r.ListRetries > 0 {
|
||||||
listRetries = r.ListRetries
|
listRetries = r.ListRetries
|
||||||
|
|
Loading…
Reference in New Issue
Block a user