diff options
author | gluk256 <gluk256@gmail.com> | 2019-03-22 18:20:17 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2019-03-22 18:20:17 +0800 |
commit | 8d04154691ef497f18816ac720f58b650d25e1e2 (patch) | |
tree | 724d259eaa5c92f6b17e72f65d723fb604af842a /swarm/network/simulation/node_test.go | |
parent | 09924cbcaab5106951fb67648315131bb4024ac5 (diff) | |
download | go-tangerine-8d04154691ef497f18816ac720f58b650d25e1e2.tar go-tangerine-8d04154691ef497f18816ac720f58b650d25e1e2.tar.gz go-tangerine-8d04154691ef497f18816ac720f58b650d25e1e2.tar.bz2 go-tangerine-8d04154691ef497f18816ac720f58b650d25e1e2.tar.lz go-tangerine-8d04154691ef497f18816ac720f58b650d25e1e2.tar.xz go-tangerine-8d04154691ef497f18816ac720f58b650d25e1e2.tar.zst go-tangerine-8d04154691ef497f18816ac720f58b650d25e1e2.zip |
p2p/simulations: wait until all connections are recreated when uploading snapshot (#19312)
* swarm/network/simulation: test cases refactored
* swarm/pss: minor refactoring
* swarm/simulation: UploadSnapshot updated
* swarm/network: style fix
* swarm/pss: bugfix
Diffstat (limited to 'swarm/network/simulation/node_test.go')
-rw-r--r-- | swarm/network/simulation/node_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/swarm/network/simulation/node_test.go b/swarm/network/simulation/node_test.go index bae5afb26..e1e20a0f1 100644 --- a/swarm/network/simulation/node_test.go +++ b/swarm/network/simulation/node_test.go @@ -289,6 +289,7 @@ func TestUploadSnapshot(t *testing.T) { HiveParams: hp, } kad := network.NewKademlia(addr.Over(), network.NewKadParams()) + b.Store(BucketKeyKademlia, kad) return network.NewBzz(config, kad, nil, nil, nil), nil, nil }, }) @@ -296,12 +297,13 @@ func TestUploadSnapshot(t *testing.T) { nodeCount := 16 log.Debug("Uploading snapshot") - err := s.UploadSnapshot(fmt.Sprintf("../stream/testing/snapshot_%d.json", nodeCount)) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err := s.UploadSnapshot(ctx, fmt.Sprintf("../stream/testing/snapshot_%d.json", nodeCount)) if err != nil { t.Fatalf("Error uploading snapshot to simulation network: %v", err) } - ctx := context.Background() log.Debug("Starting simulation...") s.Run(ctx, func(ctx context.Context, sim *Simulation) error { log.Debug("Checking") |