Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/swarm/swarm-smoke/feed_upload_and_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const (
feedRandomDataLength = 8
)

func feedUploadAndSyncCmd(ctx *cli.Context, tuid string) error {
func feedUploadAndSyncCmd(ctx *cli.Context) error {
errc := make(chan error)

go func() {
errc <- feedUploadAndSync(ctx, tuid)
errc <- feedUploadAndSync(ctx)
}()

select {
Expand All @@ -46,7 +46,7 @@ func feedUploadAndSyncCmd(ctx *cli.Context, tuid string) error {
}
}

func feedUploadAndSync(c *cli.Context, tuid string) error {
func feedUploadAndSync(c *cli.Context) error {
log.Info("generating and uploading feeds to " + httpEndpoint(hosts[0]) + " and syncing")

// create a random private key to sign updates with and derive the address
Expand Down Expand Up @@ -272,7 +272,7 @@ func feedUploadAndSync(c *cli.Context, tuid string) error {
ruid := uuid.New()[:8]
go func(url string, endpoint string, ruid string) {
for {
err := fetch(url, endpoint, fileHash, ruid, "")
err := fetch(url, endpoint, fileHash, ruid)
if err != nil {
continue
}
Expand Down
33 changes: 16 additions & 17 deletions cmd/swarm/swarm-smoke/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ var (
)

var (
allhosts string
hosts []string
filesize int
inputSeed int
syncDelay int
httpPort int
wsPort int
verbosity int
timeout int
single bool
trackTimeout int
allhosts string
hosts []string
filesize int
syncDelay int
inputSeed int
httpPort int
wsPort int
verbosity int
timeout int
single bool
onlyUpload bool
)

func main() {
Expand Down Expand Up @@ -101,7 +101,7 @@ func main() {
},
cli.IntFlag{
Name: "timeout",
Value: 120,
Value: 180,
Usage: "timeout in seconds after which kill the process",
Destination: &timeout,
},
Expand All @@ -110,11 +110,10 @@ func main() {
Usage: "whether to fetch content from a single node or from all nodes",
Destination: &single,
},
cli.IntFlag{
Name: "track-timeout",
Value: 5,
Usage: "timeout in seconds to wait for GetAllReferences to return",
Destination: &trackTimeout,
cli.BoolFlag{
Name: "only-upload",
Comment thread
acud marked this conversation as resolved.
Usage: "whether to only upload content to a single node without fetching",
Destination: &onlyUpload,
},
}

Expand Down
10 changes: 5 additions & 5 deletions cmd/swarm/swarm-smoke/sliding_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ type uploadResult struct {
digest []byte
}

func slidingWindowCmd(ctx *cli.Context, tuid string) error {
func slidingWindowCmd(ctx *cli.Context) error {
errc := make(chan error)

go func() {
errc <- slidingWindow(ctx, tuid)
errc <- slidingWindow(ctx)
}()

err := <-errc
Expand All @@ -49,10 +49,10 @@ func slidingWindowCmd(ctx *cli.Context, tuid string) error {
return err
}

func slidingWindow(ctx *cli.Context, tuid string) error {
func slidingWindow(ctx *cli.Context) error {
var hashes []uploadResult //swarm hashes of the uploads
nodes := len(hosts)
log.Info("sliding window test started", "tuid", tuid, "nodes", nodes, "filesize(kb)", filesize, "timeout", timeout)
log.Info("sliding window test started", "nodes", nodes, "filesize(kb)", filesize, "timeout", timeout)
uploadedBytes := 0
networkDepth := 0
errored := false
Expand Down Expand Up @@ -107,7 +107,7 @@ outer:
start = time.Now()
// fetch hangs when swarm dies out, so we have to jump through a bit more hoops to actually
// catch the timeout, but also allow this retry logic
err := fetch(v.hash, httpEndpoint(hosts[idx]), v.digest, ruid, "")
err := fetch(v.hash, httpEndpoint(hosts[idx]), v.digest, ruid)
if err != nil {
log.Error("error fetching hash", "err", err)
continue
Expand Down
Loading