Skip to content

Commit

Permalink
fix(storagemarket): fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward committed Nov 11, 2020
1 parent 9726b0d commit 24fdce3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/ipfs/go-blockservice v0.1.4-0.20200624145336-a978cec6e834
github.com/ipfs/go-cid v0.0.7
github.com/ipfs/go-datastore v0.4.5
github.com/ipfs/go-graphsync v0.4.2
github.com/ipfs/go-graphsync v0.4.3-0.20201111025458-1b22ee580973
github.com/ipfs/go-ipfs-blockstore v1.0.1
github.com/ipfs/go-ipfs-blocksutil v0.0.1
github.com/ipfs/go-ipfs-chunker v0.0.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ github.com/ipfs/go-graphsync v0.1.0 h1:RjLk7ha1tJtDXktqoxOjhvx4lDuzzIU+xQ+PEi74r
github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE=
github.com/ipfs/go-graphsync v0.4.2 h1:Y/jt5r619yj0LI7OLtGKh4jYm8goYUcuJ09y7TZ3zMo=
github.com/ipfs/go-graphsync v0.4.2/go.mod h1:/VmbZTUdUMTbNkgzAiCEucIIAU3BkLE2cZrDCVUhyi0=
github.com/ipfs/go-graphsync v0.4.3-0.20201111025458-1b22ee580973 h1:O1TZosrLfqgTGaU9HhKirQI4p0O7H82upZLa96w9IqA=
github.com/ipfs/go-graphsync v0.4.3-0.20201111025458-1b22ee580973/go.mod h1:mPOwDYv128gf8gxPFgXnz4fNrSYPsWyqisJ7ych+XDY=
github.com/ipfs/go-hamt-ipld v0.1.1 h1:0IQdvwnAAUKmDE+PMJa5y1QiwOPHpI9+eAbQEEEYthk=
github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk=
github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08=
Expand Down
10 changes: 8 additions & 2 deletions storagemarket/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ func TestMakeDealOffline(t *testing.T) {

cd, err := h.Client.GetLocalDeal(ctx, proposalCid)
assert.NoError(t, err)
shared_testutil.AssertDealState(t, storagemarket.StorageDealCheckForAcceptance, cd.State)
require.Eventually(t, func() bool {
cd, _ = h.Client.GetLocalDeal(ctx, proposalCid)
return cd.State == storagemarket.StorageDealCheckForAcceptance
}, 1*time.Second, 100*time.Millisecond, "actual deal status is %s", storagemarket.DealStates[cd.State])

providerDeals, err := h.Provider.ListLocalDeals()
assert.NoError(t, err)
Expand Down Expand Up @@ -274,6 +277,9 @@ func TestMakeDealNonBlocking(t *testing.T) {
pd := providerDeals[0]
assert.Equal(t, result.ProposalCid, pd.ProposalCid)
require.Eventually(t, func() bool {
providerDeals, err := h.Provider.ListLocalDeals()
assert.NoError(t, err)
pd = providerDeals[0]
return pd.State == storagemarket.StorageDealProviderFunding
}, 1*time.Second, 100*time.Millisecond, "actual deal status is %s", storagemarket.DealStates[pd.State])
}
Expand Down Expand Up @@ -404,7 +410,7 @@ func TestRestartClient(t *testing.T) {
expectedClientState: storagemarket.StorageDealCheckForAcceptance,
},

"ClientEventFundsReserved": {
"ClientEventFundingComplete": {
//Edge case : Provider begins the state machine on recieving a deal stream request
//client crashes -> restarts -> sends deal stream again -> state machine fails
// See https://github.com/filecoin-project/lotus/issues/3966
Expand Down

0 comments on commit 24fdce3

Please sign in to comment.