Skip to content

Commit

Permalink
fix test and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshkshah1992 committed Sep 2, 2020
1 parent 34e8aef commit 8e44630
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion retrievalmarket/impl/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ func TestProvider_Stop(t *testing.T) {
client, expectedCIDs, _, _, retrievalPeer, provider := requireSetupTestClientAndProvider(bgCtx, t, payChAddr)
require.NoError(t, provider.Stop())
_, err := client.Query(bgCtx, retrievalPeer, expectedCIDs[0], retrievalmarket.QueryParams{})
assert.EqualError(t, err, "protocol not supported")

assert.EqualError(t, err, "exhausted 5 attempts but failed to open stream, err: protocol not supported")
}

func requireSetupTestClientAndProvider(bgCtx context.Context, t *testing.T, payChAddr address.Address) (retrievalmarket.RetrievalClient,
Expand Down
8 changes: 6 additions & 2 deletions storagemarket/network/libp2p_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,21 @@ func TestOpenStreamWithRetries(t *testing.T) {
require.NoError(t, err)
achan <- readq
}}

var err error

go func() {
select {
case _ = <-time.After(3 * time.Second):
toNetwork.SetDelegate(tr2)
case <-time.After(3 * time.Second):
err = toNetwork.SetDelegate(tr2)
case <-ctx.Done():
return
}
}()

// setup query stream host1 --> host 2
assertAskRequestReceived(ctx, t, fromNetwork, toHost, achan)
assert.NoError(t, err)
}

func TestAskStreamSendReceiveAskRequest(t *testing.T) {
Expand Down

0 comments on commit 8e44630

Please sign in to comment.