diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-07-09 20:11:49 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-07-09 20:11:49 +0800 |
commit | b3711af05176f446fad5ee90e2be4bd09c4086a2 (patch) | |
tree | 036eb23e423c385c0be00e3f8d3d97dea7040f8c /swarm/network/stream/snapshot_retrieval_test.go | |
parent | 30bdf817a0d0afb33f3635f1de877f9caf09be05 (diff) | |
download | dexon-b3711af05176f446fad5ee90e2be4bd09c4086a2.tar dexon-b3711af05176f446fad5ee90e2be4bd09c4086a2.tar.gz dexon-b3711af05176f446fad5ee90e2be4bd09c4086a2.tar.bz2 dexon-b3711af05176f446fad5ee90e2be4bd09c4086a2.tar.lz dexon-b3711af05176f446fad5ee90e2be4bd09c4086a2.tar.xz dexon-b3711af05176f446fad5ee90e2be4bd09c4086a2.tar.zst dexon-b3711af05176f446fad5ee90e2be4bd09c4086a2.zip |
swarm: ctx propagation; bmt fixes; pss generic notification framework (#17150)
* cmd/swarm: minor cli flag text adjustments
* swarm/api/http: sticky footer for swarm landing page using flex
* swarm/api/http: sticky footer for error pages and fix for multiple choices
* cmd/swarm, swarm/storage, swarm: fix mingw on windows test issues
* cmd/swarm: update description of swarm cmd
* swarm: added network ID test
* cmd/swarm: support for smoke tests on the production swarm cluster
* cmd/swarm/swarm-smoke: simplify cluster logic as per suggestion
* swarm: propagate ctx to internal apis (#754)
* swarm/metrics: collect disk measurements
* swarm/bmt: fix io.Writer interface
* Write now tolerates arbitrary variable buffers
* added variable buffer tests
* Write loop and finalise optimisation
* refactor / rename
* add tests for empty input
* swarm/pss: (UPDATE) Generic notifications package (#744)
swarm/pss: Generic package for creating pss notification svcs
* swarm: Adding context to more functions
* swarm/api: change colour of landing page in templates
* swarm/api: change landing page to react to enter keypress
Diffstat (limited to 'swarm/network/stream/snapshot_retrieval_test.go')
-rw-r--r-- | swarm/network/stream/snapshot_retrieval_test.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/swarm/network/stream/snapshot_retrieval_test.go b/swarm/network/stream/snapshot_retrieval_test.go index 59c776c30..da5253e8a 100644 --- a/swarm/network/stream/snapshot_retrieval_test.go +++ b/swarm/network/stream/snapshot_retrieval_test.go @@ -410,7 +410,7 @@ func runFileRetrievalTest(nodeCount int) error { fileStore := registries[id].fileStore //check all chunks for i, hash := range conf.hashes { - reader, _ := fileStore.Retrieve(hash) + reader, _ := fileStore.Retrieve(context.TODO(), hash) //check that we can read the file size and that it corresponds to the generated file size if s, err := reader.Size(nil); err != nil || s != int64(len(randomFiles[i])) { allSuccess = false @@ -697,7 +697,7 @@ func runRetrievalTest(chunkCount int, nodeCount int) error { fileStore := registries[id].fileStore //check all chunks for _, chnk := range conf.hashes { - reader, _ := fileStore.Retrieve(chnk) + reader, _ := fileStore.Retrieve(context.TODO(), chnk) //assuming that reading the Size of the chunk is enough to know we found it if s, err := reader.Size(nil); err != nil || s != chunkSize { allSuccess = false @@ -765,9 +765,13 @@ func uploadFilesToNodes(nodes []*simulations.Node) ([]storage.Address, []string, return nil, nil, err } //store it (upload it) on the FileStore - rk, wait, err := fileStore.Store(strings.NewReader(rfiles[i]), int64(len(rfiles[i])), false) + ctx := context.TODO() + rk, wait, err := fileStore.Store(ctx, strings.NewReader(rfiles[i]), int64(len(rfiles[i])), false) log.Debug("Uploaded random string file to node") - wait() + if err != nil { + return nil, nil, err + } + err = wait(ctx) if err != nil { return nil, nil, err } |