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
2
2
3
3
require (
4
4
github.com/google/uuid v1.6.0
5
- github.com/ipfs/go-detect-race v0.0.1
6
5
github.com/ipfs/go-ipfs-delay v0.0.1
7
6
github.com/jbenet/goprocess v0.1.4
8
7
go.opentelemetry.io/otel v1.16.0
9
8
go.opentelemetry.io/otel/trace v1.16.0
10
9
go.uber.org/multierr v1.11.0
11
- golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
12
10
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
13
11
)
14
12
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
9
9
github.com/google/go-cmp v0.5.9 /go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY =
10
10
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0 =
11
11
github.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 =
14
12
github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ =
15
13
github.com/ipfs/go-ipfs-delay v0.0.1 /go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw =
16
14
github.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
33
31
go.opentelemetry.io/otel/trace v1.16.0 /go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0 =
34
32
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0 =
35
33
go.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 =
38
34
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo =
39
35
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
40
36
gopkg.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
4
4
5
5
import (
6
6
"context"
7
+ "fmt"
7
8
"time"
8
9
9
10
ds "github.com/ipfs/go-datastore"
10
- xerrors "golang.org/x/xerrors"
11
11
)
12
12
13
13
// Datastore wraps a Batching datastore with a
@@ -28,8 +28,6 @@ var _ ds.Datastore = (*Datastore)(nil)
28
28
var _ ds.Batching = (* Datastore )(nil )
29
29
var _ ds.PersistentDatastore = (* Datastore )(nil )
30
30
31
- var errFmtString = "ran out of retries trying to get past temporary error: %w"
32
-
33
31
func (d * Datastore ) runOp (op func () error ) error {
34
32
err := op ()
35
33
if err == nil || ! d .TempErrFunc (err ) {
@@ -45,7 +43,7 @@ func (d *Datastore) runOp(op func() error) error {
45
43
}
46
44
}
47
45
48
- return xerrors .Errorf (errFmtString , err )
46
+ return fmt .Errorf ("ran out of retries trying to get past temporary error: %w" , err )
49
47
}
50
48
51
49
// DiskUsage implements the PersistentDatastore interface.
Original file line number Diff line number Diff line change 9
9
"strings"
10
10
"testing"
11
11
12
- detectrace "github.com/ipfs/go-detect-race"
13
-
14
12
dstore "github.com/ipfs/go-datastore"
15
13
dsq "github.com/ipfs/go-datastore/query"
16
14
)
@@ -20,14 +18,6 @@ import (
20
18
// 20, 30, 40... and at least to 20.
21
19
var ElemCount = 100
22
20
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
-
31
21
func TestElemCount (t * testing.T ) {
32
22
if ElemCount < 20 {
33
23
t .Fatal ("ElemCount should be set to 20 at least" )
Original file line number Diff line number Diff line change 6
6
"runtime"
7
7
"testing"
8
8
9
- detectrace "github.com/ipfs/go-detect-race"
10
-
11
9
dstore "github.com/ipfs/go-datastore"
12
10
query "github.com/ipfs/go-datastore/query"
13
11
)
@@ -23,13 +21,7 @@ var BasicSubtests = []func(t *testing.T, ds dstore.Datastore){
23
21
SubtestManyKeysAndQuery ,
24
22
SubtestReturnSizes ,
25
23
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 ,
33
25
}
34
26
35
27
// BatchSubtests is a list of all basic batching datastore tests.
You can’t perform that action at this time.
0 commit comments