Commit 26bf7962 authored by Steven Allen's avatar Steven Allen

test: remove overlap3 and simplify overlap2

overlap3 and 2 are identical
parent 2a9ebedf
...@@ -52,24 +52,20 @@ func BenchmarkDups2Nodes(b *testing.B) { ...@@ -52,24 +52,20 @@ func BenchmarkDups2Nodes(b *testing.B) {
subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap1, oneAtATime) subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap1, oneAtATime)
}) })
b.Run("Overlap2-BatchBy10", func(b *testing.B) {
subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap2, batchFetchBy10)
})
b.Run("Overlap3-OneAtATime", func(b *testing.B) { b.Run("Overlap3-OneAtATime", func(b *testing.B) {
subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap3, oneAtATime) subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap2, oneAtATime)
}) })
b.Run("Overlap3-BatchBy10", func(b *testing.B) { b.Run("Overlap3-BatchBy10", func(b *testing.B) {
subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap3, batchFetchBy10) subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap2, batchFetchBy10)
}) })
b.Run("Overlap3-AllConcurrent", func(b *testing.B) { b.Run("Overlap3-AllConcurrent", func(b *testing.B) {
subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap3, fetchAllConcurrent) subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap2, fetchAllConcurrent)
}) })
b.Run("Overlap3-BigBatch", func(b *testing.B) { b.Run("Overlap3-BigBatch", func(b *testing.B) {
subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap3, batchFetchAll) subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap2, batchFetchAll)
}) })
b.Run("Overlap3-UnixfsFetch", func(b *testing.B) { b.Run("Overlap3-UnixfsFetch", func(b *testing.B) {
subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap3, unixfsFileFetch) subtestDistributeAndFetch(b, 3, 100, fixedDelay, overlap2, unixfsFileFetch)
}) })
b.Run("10Nodes-AllToAll-OneAtATime", func(b *testing.B) { b.Run("10Nodes-AllToAll-OneAtATime", func(b *testing.B) {
subtestDistributeAndFetch(b, 10, 100, fixedDelay, allToAll, oneAtATime) subtestDistributeAndFetch(b, 10, 100, fixedDelay, allToAll, oneAtATime)
...@@ -250,38 +246,18 @@ func overlap2(b *testing.B, provs []testinstance.Instance, blks []blocks.Block) ...@@ -250,38 +246,18 @@ func overlap2(b *testing.B, provs []testinstance.Instance, blks []blocks.Block)
bill := provs[0] bill := provs[0]
jeff := provs[1] jeff := provs[1]
bill.Blockstore().Put(blks[0])
jeff.Blockstore().Put(blks[0])
for i, blk := range blks { for i, blk := range blks {
if i%3 == 0 { even := i%2 == 0
bill.Blockstore().Put(blk) third := i%3 == 0
jeff.Blockstore().Put(blk) if third || even {
} else if i%2 == 1 { if err := bill.Blockstore().Put(blk); err != nil {
bill.Blockstore().Put(blk) b.Fatal(err)
} else {
jeff.Blockstore().Put(blk)
} }
} }
} if third || !even {
if err := jeff.Blockstore().Put(blk); err != nil {
func overlap3(b *testing.B, provs []testinstance.Instance, blks []blocks.Block) { b.Fatal(err)
if len(provs) != 2 {
b.Fatal("overlap3 only works with 2 provs")
} }
bill := provs[0]
jeff := provs[1]
bill.Blockstore().Put(blks[0])
jeff.Blockstore().Put(blks[0])
for i, blk := range blks {
if i%3 == 0 {
bill.Blockstore().Put(blk)
jeff.Blockstore().Put(blk)
} else if i%2 == 1 {
bill.Blockstore().Put(blk)
} else {
jeff.Blockstore().Put(blk)
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment