Skip to content

Commit

Permalink
plumb through pseudoversions for context changes
Browse files Browse the repository at this point in the history
This is for testing the libp2p release, since the context changes are
not plumbed all the way through.
  • Loading branch information
guseggert committed Nov 16, 2021
1 parent 97993d8 commit 5358b0d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 47 deletions.
15 changes: 7 additions & 8 deletions core/coreapi/test/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/ipld/go-ipld-prime"
)


func TestPathUnixFSHAMTPartial(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand All @@ -27,16 +26,16 @@ func TestPathUnixFSHAMTPartial(t *testing.T) {
a := apis[0]

// Setting this after instantiating the swarm so that it's not clobbered by loading the go-ipfs config
prevVal := uio.UseHAMTSharding
uio.UseHAMTSharding = true
defer func() {
uio.UseHAMTSharding = prevVal
}()
// prevVal := uio.UseHAMTSharding
// uio.UseHAMTSharding = true
// defer func() {
// uio.UseHAMTSharding = prevVal
// }()

// Create and add a sharded directory
dir := make(map[string]files.Node)
// Make sure we have at least two levels of sharding
for i := 0; i < uio.DefaultShardWidth + 1; i++ {
for i := 0; i < uio.DefaultShardWidth+1; i++ {
dir[strconv.Itoa(i)] = files.NewBytesFile([]byte(strconv.Itoa(i)))
}

Expand Down Expand Up @@ -67,7 +66,7 @@ func TestPathUnixFSHAMTPartial(t *testing.T) {
for k := range dir {
// The node will go out to the (non-existent) network looking for the missing block. Make sure we're erroring
// because we exceeded the timeout on our query
timeoutCtx, timeoutCancel := context.WithTimeout(ctx, time.Second * 1)
timeoutCtx, timeoutCancel := context.WithTimeout(ctx, time.Second*1)
_, err := a.ResolveNode(timeoutCtx, path.Join(r, k))
if err != nil {
if timeoutCtx.Err() == nil {
Expand Down
14 changes: 7 additions & 7 deletions core/coreunix/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestAddMultipleGCLive(t *testing.T) {

go func() {
defer close(out)
_, _ = adder.AddAllAndPin(slf)
_, _ = adder.AddAllAndPin(context.Background(), slf)
// Ignore errors for clarity - the real bug would be gc'ing files while adding them, not this resultant error
}()

Expand Down Expand Up @@ -179,7 +179,7 @@ func TestAddGCLive(t *testing.T) {
go func() {
defer close(addDone)
defer close(out)
_, err := adder.AddAllAndPin(slf)
_, err := adder.AddAllAndPin(context.Background(), slf)

if err != nil {
t.Error(err)
Expand Down Expand Up @@ -288,7 +288,7 @@ func testAddWPosInfo(t *testing.T, rawLeaves bool) {

go func() {
defer close(adder.Out)
_, err = adder.AddAllAndPin(file)
_, err = adder.AddAllAndPin(context.Background(), file)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -327,16 +327,16 @@ type testBlockstore struct {
countAtOffsetNonZero int
}

func (bs *testBlockstore) Put(block blocks.Block) error {
func (bs *testBlockstore) Put(ctx context.Context, block blocks.Block) error {
bs.CheckForPosInfo(block)
return bs.GCBlockstore.Put(block)
return bs.GCBlockstore.Put(ctx, block)
}

func (bs *testBlockstore) PutMany(blocks []blocks.Block) error {
func (bs *testBlockstore) PutMany(ctx context.Context, blocks []blocks.Block) error {
for _, blk := range blocks {
bs.CheckForPosInfo(blk)
}
return bs.GCBlockstore.PutMany(blocks)
return bs.GCBlockstore.PutMany(ctx, blocks)
}

func (bs *testBlockstore) CheckForPosInfo(block blocks.Block) {
Expand Down
16 changes: 7 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/fsnotify/fsnotify v1.4.9
github.com/gabriel-vasile/mimetype v1.1.2
github.com/go-bindata/go-bindata/v3 v3.1.3
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect
github.com/hashicorp/go-multierror v1.1.1
github.com/ipfs/go-bitswap v0.5.0
github.com/ipfs/go-block-format v0.0.3
Expand All @@ -21,10 +20,10 @@ require (
github.com/ipfs/go-datastore v0.5.0
github.com/ipfs/go-detect-race v0.0.1
github.com/ipfs/go-ds-badger v0.3.0
github.com/ipfs/go-ds-flatfs v0.4.6-0.20211022215308-063e7297c4c4
github.com/ipfs/go-ds-flatfs v0.5.0
github.com/ipfs/go-ds-leveldb v0.5.0
github.com/ipfs/go-ds-measure v0.1.1-0.20211022215957-ab1649254335
github.com/ipfs/go-fetcher v1.5.0
github.com/ipfs/go-ds-measure v0.2.0
github.com/ipfs/go-fetcher v1.6.0
github.com/ipfs/go-filestore v1.0.1-0.20211022220855-bad9642b9398
github.com/ipfs/go-fs-lock v0.0.7
github.com/ipfs/go-graphsync v0.10.5-0.20211022221432-61a702bcea25
Expand All @@ -36,9 +35,9 @@ require (
github.com/ipfs/go-ipfs-exchange-offline v0.1.0
github.com/ipfs/go-ipfs-files v0.0.9
github.com/ipfs/go-ipfs-keystore v0.0.2
github.com/ipfs/go-ipfs-pinner v0.1.3-0.20211022224820-71e2b1511fd2
github.com/ipfs/go-ipfs-pinner v0.2.0
github.com/ipfs/go-ipfs-posinfo v0.0.1
github.com/ipfs/go-ipfs-provider v0.6.2-0.20211025183630-eb8461370f74
github.com/ipfs/go-ipfs-provider v0.7.0
github.com/ipfs/go-ipfs-routing v0.2.0
github.com/ipfs/go-ipfs-util v0.0.2
github.com/ipfs/go-ipld-cbor v0.0.5
Expand All @@ -52,7 +51,7 @@ require (
github.com/ipfs/go-metrics-prometheus v0.0.2
github.com/ipfs/go-mfs v0.1.3-0.20211025170123-e41b40a71677
github.com/ipfs/go-namesys v0.3.2-0.20211025145726-331d6bea5fc9
github.com/ipfs/go-path v0.1.3-0.20211021180819-6f599234c77d
github.com/ipfs/go-path v0.2.0
github.com/ipfs/go-pinning-service-http-client v0.1.0
github.com/ipfs/go-unixfs v0.2.7-0.20211021174028-9e137ae83d40
github.com/ipfs/go-unixfsnode v1.1.4-0.20211021180004-3d0f9aae0add
Expand All @@ -77,7 +76,7 @@ require (
github.com/libp2p/go-libp2p-mplex v0.4.1
github.com/libp2p/go-libp2p-noise v0.3.0
github.com/libp2p/go-libp2p-peerstore v0.4.0
github.com/libp2p/go-libp2p-pubsub v0.5.6-0.20211022213958-eb85e0b9a30f
github.com/libp2p/go-libp2p-pubsub v0.6.0
github.com/libp2p/go-libp2p-pubsub-router v0.4.1-0.20211025173248-17875e5a4465
github.com/libp2p/go-libp2p-quic-transport v0.14.0
github.com/libp2p/go-libp2p-record v0.1.3
Expand Down Expand Up @@ -109,7 +108,6 @@ require (
go.uber.org/fx v1.13.1
go.uber.org/zap v1.19.0
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20211025112917-711f33c9992c
)
Expand Down
32 changes: 17 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,8 @@ github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE0
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4=
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f h1:KMlcu9X58lhTA/KrfX8Bi1LQSO4pzoVjTiL3h4Jk+Zk=
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
Expand Down Expand Up @@ -437,19 +436,20 @@ github.com/ipfs/go-ds-badger v0.2.7/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6
github.com/ipfs/go-ds-badger v0.2.8-0.20211014032316-05534b799774/go.mod h1:duXiXbQ5YUbnU7wI4U/8evVoveRASH9/5kuszt2srAc=
github.com/ipfs/go-ds-badger v0.3.0 h1:xREL3V0EH9S219kFFueOYJJTcjgNSZ2HY1iSvN7U1Ro=
github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek=
github.com/ipfs/go-ds-flatfs v0.4.6-0.20211022215308-063e7297c4c4 h1:GB9LLoLKwn4gfTq/QRx61xmJ7hHMsSrtDyfYHoQQQuI=
github.com/ipfs/go-ds-flatfs v0.4.6-0.20211022215308-063e7297c4c4/go.mod h1:7BtRAF8WObIzbuiz+2Kj7/W/Vl+b/iH1375ITYreREI=
github.com/ipfs/go-ds-flatfs v0.5.0 h1:ntq2P05cC51VOSZ0VO/HRaCoLefVXNKGRu9gYr9Ajko=
github.com/ipfs/go-ds-flatfs v0.5.0/go.mod h1:RWTV7oZD/yZYBKdbVIFXTX2fdY2Tbvl94NsWqmoyAX4=
github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc=
github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8=
github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s=
github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s=
github.com/ipfs/go-ds-leveldb v0.4.3-0.20211014125523-8bc38be4745f/go.mod h1:qYAG1yVJSOmj1yFnriiP8YfmgjnJzR0NZgJRFlkPItk=
github.com/ipfs/go-ds-leveldb v0.5.0 h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUNumo=
github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q=
github.com/ipfs/go-ds-measure v0.1.1-0.20211022215957-ab1649254335 h1:ZboRc7ByrT0E0Yjc9A3wqFTfSTfeEdBb8Dfiqfw4oE4=
github.com/ipfs/go-ds-measure v0.1.1-0.20211022215957-ab1649254335/go.mod h1:7Z2zZBRTW8lhUshJGEhR90BBLf61TnQ/AYA3olf1uA4=
github.com/ipfs/go-fetcher v1.5.0 h1:oreKTKBzja3S09rSmoZlA3KGVlRiUbJ1pQjtB4K6y3w=
github.com/ipfs/go-ds-measure v0.2.0 h1:sG4goQe0KDTccHMyT45CY1XyUbxe5VwTKpg2LjApYyQ=
github.com/ipfs/go-ds-measure v0.2.0/go.mod h1:SEUD/rE2PwRa4IQEC5FuNAmjJCyYObZr9UvVh8V3JxE=
github.com/ipfs/go-fetcher v1.5.0/go.mod h1:5pDZ0393oRF/fHiLmtFZtpMNBQfHOYNPtryWedVuSWE=
github.com/ipfs/go-fetcher v1.6.0 h1:rhIFI2bHJSh+spbFGIpa92vPM8lz1Dd88bRCbhBRL9k=
github.com/ipfs/go-fetcher v1.6.0/go.mod h1:TDhTfqMOdqSfqvhheJlU1bhEip7VyiIOb11gSRaRdec=
github.com/ipfs/go-filestore v1.0.1-0.20211022220855-bad9642b9398 h1:svE237y+EkxcVBk4rn9fP6jTfzQbuwDfLRlefc4sLJ4=
github.com/ipfs/go-filestore v1.0.1-0.20211022220855-bad9642b9398/go.mod h1:okqrSoyjEUSnJaFbPVVLzie5DvDO49I2rElsa32qGAI=
github.com/ipfs/go-fs-lock v0.0.7 h1:6BR3dajORFrFTkb5EpCUFIAypsoxpGpDSVUdFwzgL9U=
Expand Down Expand Up @@ -496,15 +496,15 @@ github.com/ipfs/go-ipfs-files v0.0.9 h1:OFyOfmuVDu9c5YtjSDORmwXzE6fmZikzZpzsnNkg
github.com/ipfs/go-ipfs-files v0.0.9/go.mod h1:aFv2uQ/qxWpL/6lidWvnSQmaVqCrf0TBGoUr+C1Fo84=
github.com/ipfs/go-ipfs-keystore v0.0.2 h1:Fa9xg9IFD1VbiZtrNLzsD0GuELVHUFXCWF64kCPfEXU=
github.com/ipfs/go-ipfs-keystore v0.0.2/go.mod h1:H49tRmibOEs7gLMgbOsjC4dqh1u5e0R/SWuc2ScfgSo=
github.com/ipfs/go-ipfs-pinner v0.1.3-0.20211022224820-71e2b1511fd2 h1:woKharU9lXw2UpoCenKI7YxF1aWf98zjHHOjrqt3Od0=
github.com/ipfs/go-ipfs-pinner v0.1.3-0.20211022224820-71e2b1511fd2/go.mod h1:e+U6R9aIJbuOSKiLQXLeXLijmiH45sjnnt5cssaZSZU=
github.com/ipfs/go-ipfs-pinner v0.2.0 h1:MlypHNw1ojguDZiWGVCklfJd7iLRBlpG0CQTD5SuBT4=
github.com/ipfs/go-ipfs-pinner v0.2.0/go.mod h1:4oR7SpZ4092dBZnI2VHM7rz28BL6YWXBm6vKVArPErA=
github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs=
github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A=
github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY=
github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY=
github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY=
github.com/ipfs/go-ipfs-provider v0.6.2-0.20211025183630-eb8461370f74 h1:Fo5c32l8qtZ2rEoK+5aKhSQNSV2X3kGX5xhQFyYLCNI=
github.com/ipfs/go-ipfs-provider v0.6.2-0.20211025183630-eb8461370f74/go.mod h1:ri2zPI2U0SheIKhUKwix6OLc3Nrjre92Gjj+SHRwck4=
github.com/ipfs/go-ipfs-provider v0.7.0 h1:5GpHv46eIS8h2mbbKg1ckU5paajDYJtE4GA/SBepOQg=
github.com/ipfs/go-ipfs-provider v0.7.0/go.mod h1:mgjsWgDt9j19N1REPxRa31p+eRIQmjNt5McNdQQ5CsA=
github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs=
github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY=
github.com/ipfs/go-ipfs-routing v0.1.1-0.20211014021338-c0dedb93d93e/go.mod h1:Gf2fktKBGHSy23DE4RNkTnQfcGgR14ELXjr9Yir/rDw=
Expand Down Expand Up @@ -558,8 +558,9 @@ github.com/ipfs/go-mfs v0.1.3-0.20211025170123-e41b40a71677/go.mod h1:YV7gpQTnnR
github.com/ipfs/go-namesys v0.3.2-0.20211025145726-331d6bea5fc9 h1:ad38haT8r6HSrO1QMKgCB1E/6KI2auF8VHna8ZmfdQo=
github.com/ipfs/go-namesys v0.3.2-0.20211025145726-331d6bea5fc9/go.mod h1:fV5uYdxMWXSWvhD3HTMrC/xCLqxpRnY45FlXUWSJN/o=
github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno=
github.com/ipfs/go-path v0.1.3-0.20211021180819-6f599234c77d h1:6YGyDvRY/FlpzSKq5zPy7RnPxNx9nsdROwANG0VrEP4=
github.com/ipfs/go-path v0.1.3-0.20211021180819-6f599234c77d/go.mod h1:DvdS+ff8kQby6pkjBl4LZQlVdM+5LTIcKoHWqf4MekI=
github.com/ipfs/go-path v0.2.0 h1:v0Bj0CO+7Cxzvm3xKzu/gqq039y9B/yW5Bsxd+Ziwpw=
github.com/ipfs/go-path v0.2.0/go.mod h1:6Uytu/I2CzUFjq2IEQj9p2RdzZz9aJdEeRFMzt7FcTs=
github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ=
github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U=
github.com/ipfs/go-peertaskqueue v0.1.1/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U=
Expand All @@ -573,6 +574,7 @@ github.com/ipfs/go-pinning-service-http-client v0.1.0/go.mod h1:tcCKmlkWWH9JUUkK
github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw=
github.com/ipfs/go-unixfs v0.2.7-0.20211021174028-9e137ae83d40 h1:0MM0IY/RSdihkbhNe2NbHfh5T0yRmnnqjSbAjKngrTw=
github.com/ipfs/go-unixfs v0.2.7-0.20211021174028-9e137ae83d40/go.mod h1:zjzgJ3XM2HIHlhhrxtM8oz2a3npqm69Kb04JF3o/msA=
github.com/ipfs/go-unixfsnode v1.1.2/go.mod h1:5dcE2x03pyjHk4JjamXmunTMzz+VUtqvPwZjIEkfV6s=
github.com/ipfs/go-unixfsnode v1.1.4-0.20211021180004-3d0f9aae0add h1:j3rwiL5GUZFhcIioskV8WxD6l9ig07bstqo3UDp6itA=
github.com/ipfs/go-unixfsnode v1.1.4-0.20211021180004-3d0f9aae0add/go.mod h1:icRYylHN0B9rLixzxzzNOvPRiy9aRmump0QqJvOWPTA=
github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E=
Expand Down Expand Up @@ -829,8 +831,9 @@ github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6n
github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA=
github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s=
github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk=
github.com/libp2p/go-libp2p-pubsub v0.5.6-0.20211022213958-eb85e0b9a30f h1:meKGZEUbWu/r3tyh4Vc4efmRwkViErFy2hf2iN1yvDA=
github.com/libp2p/go-libp2p-pubsub v0.5.6-0.20211022213958-eb85e0b9a30f/go.mod h1:6Q4UEwRxR3eCNCWxOvL5HlKHVQ3E8g3BzG0pcuatmDY=
github.com/libp2p/go-libp2p-pubsub v0.6.0 h1:98+RXuEWW17U6cAijK1yaTf6mw/B+n5yPA421z+dlo0=
github.com/libp2p/go-libp2p-pubsub v0.6.0/go.mod h1:nJv87QM2cU0w45KPR1rZicq+FmFIOD16zmT+ep1nOmg=
github.com/libp2p/go-libp2p-pubsub-router v0.4.1-0.20211025173248-17875e5a4465 h1:JdxGWOxr5yLZIfLGkClOaQr/dGxlYFYq0IVqZKoFysw=
github.com/libp2p/go-libp2p-pubsub-router v0.4.1-0.20211025173248-17875e5a4465/go.mod h1:i9qce45RmRK8B1RNrnwgNytBwHxKNYR+5gOYMqohd1Y=
github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA=
Expand Down Expand Up @@ -1505,9 +1508,8 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
Expand Down
9 changes: 5 additions & 4 deletions repo/fsrepo/fsrepo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fsrepo

import (
"bytes"
"context"
"io/ioutil"
"os"
"path/filepath"
Expand Down Expand Up @@ -74,10 +75,10 @@ func TestDatastoreGetNotAllowedAfterClose(t *testing.T) {

k := "key"
data := []byte(k)
assert.Nil(r.Datastore().Put(datastore.NewKey(k), data), t, "Put should be successful")
assert.Nil(r.Datastore().Put(context.Background(), datastore.NewKey(k), data), t, "Put should be successful")

assert.Nil(r.Close(), t)
_, err = r.Datastore().Get(datastore.NewKey(k))
_, err = r.Datastore().Get(context.Background(), datastore.NewKey(k))
assert.Err(err, t, "after closer, Get should be fail")
}

Expand All @@ -91,12 +92,12 @@ func TestDatastorePersistsFromRepoToRepo(t *testing.T) {

k := "key"
expected := []byte(k)
assert.Nil(r1.Datastore().Put(datastore.NewKey(k), expected), t, "using first repo, Put should be successful")
assert.Nil(r1.Datastore().Put(context.Background(), datastore.NewKey(k), expected), t, "using first repo, Put should be successful")
assert.Nil(r1.Close(), t)

r2, err := Open(path)
assert.Nil(err, t)
actual, err := r2.Datastore().Get(datastore.NewKey(k))
actual, err := r2.Datastore().Get(context.Background(), datastore.NewKey(k))
assert.Nil(err, t, "using second repo, Get should be successful")
assert.Nil(r2.Close(), t)
assert.True(bytes.Equal(expected, actual), t, "data should match")
Expand Down
8 changes: 4 additions & 4 deletions test/integration/bitswap_wo_routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"context"
"testing"

"github.com/ipfs/go-block-format"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/mock"
coremock "github.com/ipfs/go-ipfs/core/mock"
"github.com/ipfs/go-ipfs/core/node/libp2p"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
)
Expand Down Expand Up @@ -61,7 +61,7 @@ func TestBitswapWithoutRouting(t *testing.T) {
block1 := blocks.NewBlock([]byte("block1"))

// put 1 before
if err := nodes[0].Blockstore.Put(block0); err != nil {
if err := nodes[0].Blockstore.Put(ctx, block0); err != nil {
t.Fatal(err)
}

Expand All @@ -84,7 +84,7 @@ func TestBitswapWithoutRouting(t *testing.T) {
}

// put 1 after
if err := nodes[1].Blockstore.Put(block1); err != nil {
if err := nodes[1].Blockstore.Put(ctx, block1); err != nil {
t.Fatal(err)
}

Expand Down

0 comments on commit 5358b0d

Please sign in to comment.