diff --git a/cmd/swarm/swarm-smoke/sliding_window.go b/cmd/swarm/swarm-smoke/sliding_window.go index d1abd32cc4..182dd071dc 100644 --- a/cmd/swarm/swarm-smoke/sliding_window.go +++ b/cmd/swarm/swarm-smoke/sliding_window.go @@ -83,7 +83,7 @@ outer: uploadedBytes += filesize * 1000 for i, v := range hashes { - timeout := time.After(30 * time.Second) + timeout := time.After(time.Duration(timeout) * time.Second) errored = false inner: @@ -93,6 +93,7 @@ outer: errored = true log.Error("error retrieving hash. timeout", "hash idx", i, "err", err) metrics.GetOrRegisterCounter("sliding-window.single.error", nil).Inc(1) + break inner default: randIndex := 1 + rand.Intn(len(endpoints)-1) ruid := uuid.New()[:8] diff --git a/cmd/swarm/swarm-smoke/util.go b/cmd/swarm/swarm-smoke/util.go index 21eeffa65f..e029558d53 100644 --- a/cmd/swarm/swarm-smoke/util.go +++ b/cmd/swarm/swarm-smoke/util.go @@ -39,11 +39,14 @@ import ( cli "gopkg.in/urfave/cli.v1" ) +var commandName = "" + func wrapCliCommand(name string, command func(*cli.Context) error) func(*cli.Context) error { return func(ctx *cli.Context) error { log.PrintOrigins(true) log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(verbosity), log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) log.Info("smoke test starting", "task", name, "timeout", timeout) + commandName = name metrics.GetOrRegisterCounter(name, nil).Inc(1) errc := make(chan error) @@ -162,7 +165,7 @@ func fetch(hash string, endpoint string, original []byte, ruid string) error { opentracing.HTTPHeaders, opentracing.HTTPHeadersCarrier(req.Header)) - trace := client.GetClientTrace("upload-and-sync - http get", "upload-and-sync", ruid, &tn) + trace := client.GetClientTrace(commandName+" - http get", commandName, ruid, &tn) req = req.WithContext(httptrace.WithClientTrace(ctx, trace)) transport := http.DefaultTransport