diff --git a/cmd/swarm/swarm-smoke/main.go b/cmd/swarm/swarm-smoke/main.go index fa119be7ca..43d2c1ff51 100644 --- a/cmd/swarm/swarm-smoke/main.go +++ b/cmd/swarm/swarm-smoke/main.go @@ -37,16 +37,16 @@ var ( ) var ( - allhosts string - hosts []string - filesize int - syncDelay int - httpPort int - wsPort int - verbosity int - timeout int - single bool - getAllRefsTimeout int + allhosts string + hosts []string + filesize int + syncDelay int + httpPort int + wsPort int + verbosity int + timeout int + single bool + trackTimeout int ) func main() { @@ -104,10 +104,10 @@ func main() { Destination: &single, }, cli.IntFlag{ - Name: "refs-timeout", + Name: "track-timeout", Value: 5, Usage: "timeout in seconds to wait for GetAllReferences to return", - Destination: &getAllRefsTimeout, + Destination: &trackTimeout, }, } diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go index ec97db36ca..90230df253 100644 --- a/cmd/swarm/swarm-smoke/upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/upload_and_sync.go @@ -57,7 +57,7 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error { e := fmt.Errorf("timeout after %v sec", timeout) // trigger debug functionality on randomBytes - err := triggerChunkDebug(randomBytes[:]) + err := trackChunks(randomBytes[:]) if err != nil { e = fmt.Errorf("%v; triggerChunkDebug failed: %v", e, err) } @@ -66,7 +66,7 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error { } } -func triggerChunkDebug(testData []byte) error { +func trackChunks(testData []byte) error { log.Warn("Test timed out; running chunk debug sequence") addrs, err := getAllRefs(testData) @@ -117,7 +117,7 @@ func getAllRefs(testData []byte) (storage.AddressCollection, error) { if err != nil { return nil, err } - ctx, cancel := context.WithTimeout(context.Background(), time.Duration(getAllRefsTimeout)*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(trackTimeout)*time.Second) defer cancel() reader := bytes.NewReader(testData)