diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-03-16 00:36:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-16 00:36:39 +0800 |
commit | 3d067b0ceab52deaa4862189af643130ad3e4def (patch) | |
tree | 1dbcd17c5c1ad79dba379ee48edca05e377fbb39 /cmd/swarm | |
parent | f18098127321fcb9c73c77d5b577d0301aa1bebe (diff) | |
download | go-tangerine-3d067b0ceab52deaa4862189af643130ad3e4def.tar go-tangerine-3d067b0ceab52deaa4862189af643130ad3e4def.tar.gz go-tangerine-3d067b0ceab52deaa4862189af643130ad3e4def.tar.bz2 go-tangerine-3d067b0ceab52deaa4862189af643130ad3e4def.tar.lz go-tangerine-3d067b0ceab52deaa4862189af643130ad3e4def.tar.xz go-tangerine-3d067b0ceab52deaa4862189af643130ad3e4def.tar.zst go-tangerine-3d067b0ceab52deaa4862189af643130ad3e4def.zip |
cmd/swarm/swarm-smoke: do not fail if a node does not respond to rpc (#19280)
Diffstat (limited to 'cmd/swarm')
-rw-r--r-- | cmd/swarm/swarm-smoke/upload_and_sync.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go index 23b7d5688..d1032f821 100644 --- a/cmd/swarm/swarm-smoke/upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/upload_and_sync.go @@ -44,7 +44,7 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error { errc := make(chan error) go func() { - errc <- uplaodAndSync(ctx, randomBytes, tuid) + errc <- uploadAndSync(ctx, randomBytes, tuid) }() select { @@ -65,6 +65,14 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error { return e } + + // trigger debug functionality on randomBytes even on successful runs + err := trackChunks(randomBytes[:]) + if err != nil { + log.Error(err.Error()) + } + + return nil } func trackChunks(testData []byte) error { @@ -87,14 +95,14 @@ func trackChunks(testData []byte) error { rpcClient, err := rpc.Dial(httpHost) if err != nil { log.Error("Error dialing host", "err", err) - return err + continue } var hasInfo []api.HasInfo err = rpcClient.Call(&hasInfo, "bzz_has", addrs) if err != nil { log.Error("Error calling host", "err", err) - return err + continue } count := 0 @@ -134,7 +142,7 @@ func getAllRefs(testData []byte) (storage.AddressCollection, error) { return fileStore.GetAllReferences(ctx, reader, false) } -func uplaodAndSync(c *cli.Context, randomBytes []byte, tuid string) error { +func uploadAndSync(c *cli.Context, randomBytes []byte, tuid string) error { log.Info("uploading to "+httpEndpoint(hosts[0])+" and syncing", "tuid", tuid, "seed", seed) t1 := time.Now() |