1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00

Replace context.TODO in test files with context.Background

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
rht
2015-08-23 19:55:45 +07:00
parent fcf915fc47
commit 30e03b2da6
12 changed files with 30 additions and 28 deletions

View File

@ -45,7 +45,7 @@ func TestBalancedDag(t *testing.T) {
t.Fatal(err)
}
dr, err := uio.NewDagReader(context.TODO(), nd, ds)
dr, err := uio.NewDagReader(context.Background(), nd, ds)
if err != nil {
t.Fatal(err)
}
@ -102,7 +102,7 @@ func BenchmarkTrickleReadFull(b *testing.B) {
func runReadBench(b *testing.B, nd *dag.Node, ds dag.DAGService) {
for i := 0; i < b.N; i++ {
ctx, cancel := context.WithCancel(context.TODO())
ctx, cancel := context.WithCancel(context.Background())
read, err := uio.NewDagReader(ctx, nd, ds)
if err != nil {
b.Fatal(err)

View File

@ -443,7 +443,7 @@ func TestAppend(t *testing.T) {
r := bytes.NewReader(should[nbytes/2:])
blks, errs := chunk.Chan(chunk.NewSizeSplitter(r, 500))
ctx := context.TODO()
ctx := context.Background()
nnode, err := TrickleAppend(ctx, nd, dbp.New(blks, errs))
if err != nil {
t.Fatal(err)
@ -492,7 +492,7 @@ func TestMultipleAppends(t *testing.T) {
spl := chunk.SizeSplitterGen(500)
ctx := context.TODO()
ctx := context.Background()
for i := 0; i < len(should); i++ {
blks, errs := chunk.Chan(spl(bytes.NewReader(should[i : i+1])))
@ -540,7 +540,7 @@ func TestAppendSingleBytesToEmpty(t *testing.T) {
blks, errs := chunk.Chan(spl(bytes.NewReader(data[:1])))
ctx := context.TODO()
ctx := context.Background()
nnode, err := TrickleAppend(ctx, nd, dbp.New(blks, errs))
if err != nil {
t.Fatal(err)