aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/stream
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/stream
parent7ca40306af9da68a0d31439117246de8247f99d6 (diff)
downloaddexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.gz
dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.zst
dexon-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/stream')
-rw-r--r--swarm/network/stream/delivery_test.go4
-rw-r--r--swarm/network/stream/intervals_test.go2
-rw-r--r--swarm/network/stream/snapshot_retrieval_test.go4
-rw-r--r--swarm/network/stream/snapshot_sync_test.go8
-rw-r--r--swarm/network/stream/syncer_test.go2
-rw-r--r--swarm/network/stream/visualized_snapshot_sync_sim_test.go2
6 files changed, 11 insertions, 11 deletions
diff --git a/swarm/network/stream/delivery_test.go b/swarm/network/stream/delivery_test.go
index c65e1386d..70d3829b3 100644
--- a/swarm/network/stream/delivery_test.go
+++ b/swarm/network/stream/delivery_test.go
@@ -544,7 +544,7 @@ func testDeliveryFromNodes(t *testing.T, nodes, chunkCount int, skipCheck bool)
log.Debug("Waiting for kademlia")
// TODO this does not seem to be correct usage of the function, as the simulation may have no kademlias
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
return err
}
@@ -704,7 +704,7 @@ func benchmarkDeliveryFromNodes(b *testing.B, nodes, chunkCount int, skipCheck b
}
netStore := item.(*storage.NetStore)
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
return err
}
diff --git a/swarm/network/stream/intervals_test.go b/swarm/network/stream/intervals_test.go
index 121758c18..8f2bed9d6 100644
--- a/swarm/network/stream/intervals_test.go
+++ b/swarm/network/stream/intervals_test.go
@@ -115,7 +115,7 @@ func testIntervals(t *testing.T, live bool, history *Range, skipCheck bool) {
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
defer cancel()
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
t.Fatal(err)
}
diff --git a/swarm/network/stream/snapshot_retrieval_test.go b/swarm/network/stream/snapshot_retrieval_test.go
index a85d72329..d345ac8d0 100644
--- a/swarm/network/stream/snapshot_retrieval_test.go
+++ b/swarm/network/stream/snapshot_retrieval_test.go
@@ -197,7 +197,7 @@ func runFileRetrievalTest(nodeCount int) error {
if err != nil {
return err
}
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
return err
}
@@ -287,7 +287,7 @@ func runRetrievalTest(chunkCount int, nodeCount int) error {
if err != nil {
return err
}
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
return err
}
diff --git a/swarm/network/stream/snapshot_sync_test.go b/swarm/network/stream/snapshot_sync_test.go
index 7a883644b..4e4497ccd 100644
--- a/swarm/network/stream/snapshot_sync_test.go
+++ b/swarm/network/stream/snapshot_sync_test.go
@@ -204,7 +204,7 @@ func testSyncingViaGlobalSync(t *testing.T, chunkCount int, nodeCount int) {
ctx, cancelSimRun := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancelSimRun()
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
t.Fatal(err)
}
@@ -391,7 +391,7 @@ func testSyncingViaDirectSubscribe(t *testing.T, chunkCount int, nodeCount int)
return err
}
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
return err
}
@@ -471,7 +471,7 @@ func testSyncingViaDirectSubscribe(t *testing.T, chunkCount int, nodeCount int)
conf.hashes = append(conf.hashes, hashes...)
mapKeysToNodes(conf)
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
return err
}
@@ -563,7 +563,7 @@ func mapKeysToNodes(conf *synctestConfig) {
np, _, _ = pot.Add(np, a, pof)
}
- ppmap := network.NewPeerPotMap(network.NewKadParams().MinProxBinSize, conf.addrs)
+ ppmap := network.NewPeerPotMap(network.NewKadParams().NeighbourhoodSize, conf.addrs)
//for each address, run EachNeighbour on the chunk hashes pot to identify closest nodes
log.Trace(fmt.Sprintf("Generated hash chunk(s): %v", conf.hashes))
diff --git a/swarm/network/stream/syncer_test.go b/swarm/network/stream/syncer_test.go
index 09152ebfe..014ec9a98 100644
--- a/swarm/network/stream/syncer_test.go
+++ b/swarm/network/stream/syncer_test.go
@@ -189,7 +189,7 @@ func testSyncBetweenNodes(t *testing.T, nodes, chunkCount int, skipCheck bool, p
}
}
// here we distribute chunks of a random file into stores 1...nodes
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
return err
}
diff --git a/swarm/network/stream/visualized_snapshot_sync_sim_test.go b/swarm/network/stream/visualized_snapshot_sync_sim_test.go
index 638eae6e3..18b4c8fb0 100644
--- a/swarm/network/stream/visualized_snapshot_sync_sim_test.go
+++ b/swarm/network/stream/visualized_snapshot_sync_sim_test.go
@@ -72,7 +72,7 @@ func setupSim(serviceMap map[string]simulation.ServiceFunc) (int, int, *simulati
func watchSim(sim *simulation.Simulation) (context.Context, context.CancelFunc) {
ctx, cancelSimRun := context.WithTimeout(context.Background(), 1*time.Minute)
- if _, err := sim.WaitTillHealthy(ctx, 2); err != nil {
+ if _, err := sim.WaitTillHealthy(ctx); err != nil {
panic(err)
}