@@ -20,7 +20,7 @@ func TestGetProof(t *testing.T) {
2020
2121 challenge := []byte ("challenge this" )
2222 leafs , merkleProof , err := GenerateProofWithoutPersistency (
23- context . Background (),
23+ t . Context (),
2424 TreeConfig {Datadir : t .TempDir ()},
2525 hash .GenLabelHashFunc (challenge ),
2626 hash .GenMerkleHashFunc (challenge ),
@@ -41,7 +41,7 @@ func BenchmarkGetProof(b *testing.B) {
4141 securityParam := shared .T
4242 duration := time .Second * 30
4343 leafs , _ , err := GenerateProofWithoutPersistency (
44- context . Background (),
44+ b . Context (),
4545 TreeConfig {Datadir : b .TempDir ()},
4646 hash .GenLabelHashFunc (challenge ),
4747 hash .GenMerkleHashFunc (challenge ),
@@ -62,7 +62,7 @@ func TestRecoverParkedNodes(t *testing.T) {
6262 challenge := []byte ("challenge this" )
6363 leavesCounter := prometheus .NewCounter (prometheus.CounterOpts {})
6464
65- ctx , cancel := context .WithDeadline (context . Background (), time .Now ())
65+ ctx , cancel := context .WithDeadline (t . Context (), time .Now ())
6666 defer cancel ()
6767
6868 persist := func (ctx context.Context , treeCache * cache.Writer , _ uint64 ) error {
@@ -87,7 +87,7 @@ func TestRecoverParkedNodes(t *testing.T) {
8787
8888 // recover without parked nodes
8989 leafs , merkleProof , err := GenerateProofRecovery (
90- context . Background (),
90+ t . Context (),
9191 leavesCounter ,
9292 treeCfg ,
9393 hash .GenLabelHashFunc (challenge ),
@@ -131,7 +131,7 @@ func TestTreeRecovery(t *testing.T) {
131131 treeCache .Close ()
132132
133133 // recover the tree
134- treeCache , recoveredTree , err := makeRecoveryProofTree (context . Background (), treeCfg , merklehashFuncFunc , leafs )
134+ treeCache , recoveredTree , err := makeRecoveryProofTree (t . Context (), treeCfg , merklehashFuncFunc , leafs )
135135 r .NoError (err )
136136 defer treeCache .Close ()
137137 // compare the trees by examining their roots and parked nodes
0 commit comments