File tree Expand file tree Collapse file tree 5 files changed +3
-29
lines changed
Expand file tree Collapse file tree 5 files changed +3
-29
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,11 @@ module github.com/ipfs/go-datastore
22
33require (
44 github.com/google/uuid v1.6.0
5- github.com/ipfs/go-detect-race v0.0.1
65 github.com/ipfs/go-ipfs-delay v0.0.1
76 github.com/jbenet/goprocess v0.1.4
87 go.opentelemetry.io/otel v1.16.0
98 go.opentelemetry.io/otel/trace v1.16.0
109 go.uber.org/multierr v1.11.0
11- golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
1210 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
1311)
1412
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
99github.com/google/go-cmp v0.5.9 /go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY =
1010github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0 =
1111github.com/google/uuid v1.6.0 /go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo =
12- github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk =
13- github.com/ipfs/go-detect-race v0.0.1 /go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps =
1412github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ =
1513github.com/ipfs/go-ipfs-delay v0.0.1 /go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw =
1614github.com/jbenet/go-cienv v0.1.0 /go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA =
@@ -33,8 +31,6 @@ go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZE
3331go.opentelemetry.io/otel/trace v1.16.0 /go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0 =
3432go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0 =
3533go.uber.org/multierr v1.11.0 /go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y =
36- golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc =
37- golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 /go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0 =
3834gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo =
3935gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
4036gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA =
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ package retrystore
44
55import (
66 "context"
7+ "fmt"
78 "time"
89
910 ds "github.com/ipfs/go-datastore"
10- xerrors "golang.org/x/xerrors"
1111)
1212
1313// Datastore wraps a Batching datastore with a
@@ -28,8 +28,6 @@ var _ ds.Datastore = (*Datastore)(nil)
2828var _ ds.Batching = (* Datastore )(nil )
2929var _ ds.PersistentDatastore = (* Datastore )(nil )
3030
31- var errFmtString = "ran out of retries trying to get past temporary error: %w"
32-
3331func (d * Datastore ) runOp (op func () error ) error {
3432 err := op ()
3533 if err == nil || ! d .TempErrFunc (err ) {
@@ -45,7 +43,7 @@ func (d *Datastore) runOp(op func() error) error {
4543 }
4644 }
4745
48- return xerrors .Errorf (errFmtString , err )
46+ return fmt .Errorf ("ran out of retries trying to get past temporary error: %w" , err )
4947}
5048
5149// DiskUsage implements the PersistentDatastore interface.
Original file line number Diff line number Diff line change 99 "strings"
1010 "testing"
1111
12- detectrace "github.com/ipfs/go-detect-race"
13-
1412 dstore "github.com/ipfs/go-datastore"
1513 dsq "github.com/ipfs/go-datastore/query"
1614)
@@ -20,14 +18,6 @@ import (
2018// 20, 30, 40... and at least to 20.
2119var ElemCount = 100
2220
23- func init () {
24- // Reduce the default element count when the race detector is enabled so these tests don't
25- // take forever.
26- if detectrace .WithRace () {
27- ElemCount = 20
28- }
29- }
30-
3121func TestElemCount (t * testing.T ) {
3222 if ElemCount < 20 {
3323 t .Fatal ("ElemCount should be set to 20 at least" )
Original file line number Diff line number Diff line change 66 "runtime"
77 "testing"
88
9- detectrace "github.com/ipfs/go-detect-race"
10-
119 dstore "github.com/ipfs/go-datastore"
1210 query "github.com/ipfs/go-datastore/query"
1311)
@@ -23,13 +21,7 @@ var BasicSubtests = []func(t *testing.T, ds dstore.Datastore){
2321 SubtestManyKeysAndQuery ,
2422 SubtestReturnSizes ,
2523 SubtestBasicSync ,
26- }
27-
28- // Only enable the expensive "combinations" test when not running the race detector.
29- func init () {
30- if ! detectrace .WithRace () {
31- BasicSubtests = append (BasicSubtests , SubtestCombinations )
32- }
24+ SubtestCombinations ,
3325}
3426
3527// BatchSubtests is a list of all basic batching datastore tests.
You can’t perform that action at this time.
0 commit comments