aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/simulation/example_test.go
diff options
context:
space:
mode:
authorlash <nolash@users.noreply.github.com>2019-01-10 19:33:51 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2019-01-10 19:33:51 +0800
commit7240f4d800d3ffb97cf23a27d13746428d761cec (patch)
tree7a632be60e304e1aed98a826dc526df48c3a1c0e /swarm/network/simulation/example_test.go
parent7ca40306af9da68a0d31439117246de8247f99d6 (diff)
downloadgo-tangerine-7240f4d800d3ffb97cf23a27d13746428d761cec.tar
go-tangerine-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.gz
go-tangerine-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.bz2
go-tangerine-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.lz
go-tangerine-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.xz
go-tangerine-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.zst
go-tangerine-7240f4d800d3ffb97cf23a27d13746428d761cec.zip
swarm/network: Rename minproxbinsize, add as member of simulation (#18408)
* swarm/network: Rename minproxbinsize, add as member of simulation * swarm/network: Deactivate WaitTillHealthy, unreliable pending suggestpeer
Diffstat (limited to 'swarm/network/simulation/example_test.go')
-rw-r--r--swarm/network/simulation/example_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/swarm/network/simulation/example_test.go b/swarm/network/simulation/example_test.go
index e9a360dfd..9d1492979 100644
--- a/swarm/network/simulation/example_test.go
+++ b/swarm/network/simulation/example_test.go
@@ -18,8 +18,14 @@ package simulation_test
import (
"context"
+ "fmt"
+ "sync"
+ "time"
"github.com/ethereum/go-ethereum/log"
+ "github.com/ethereum/go-ethereum/node"
+ "github.com/ethereum/go-ethereum/p2p/simulations/adapters"
+ "github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/network/simulation"
)
@@ -28,10 +34,6 @@ import (
// all nodes have the their Kademlias healthy.
func ExampleSimulation_WaitTillHealthy() {
- log.Error("temporarily disabled as simulations.WaitTillHealthy cannot be trusted")
-
- /* Commented out to avoid go vet errors/warnings
-
sim := simulation.New(map[string]simulation.ServiceFunc{
"bzz": func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {
addr := network.NewAddr(ctx.Config.Node())
@@ -59,7 +61,7 @@ func ExampleSimulation_WaitTillHealthy() {
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()
- ill, err := sim.WaitTillHealthy(ctx, 2)
+ ill, err := sim.WaitTillHealthy(ctx)
if err != nil {
// inspect the latest detected not healthy kademlias
for id, kad := range ill {
@@ -71,7 +73,6 @@ func ExampleSimulation_WaitTillHealthy() {
// continue with the test
- */
}
// Watch all peer events in the simulation network, buy receiving from a channel.