Skip to content

Commit

Permalink
fetch: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan4th committed Aug 15, 2024
1 parent 25185be commit 9dcdd59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion fetch/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func TestHandleEpochInfoReq(t *testing.T) {
var resp server.Response
require.NoError(t, codec.Decode(b.Bytes(), &resp))
require.Empty(t, resp.Data)
require.Contains(t, resp.Error, "exec epoch 11: database: no free connection")
require.Contains(t, resp.Error, "exec epoch 11: database closed")
})
})
}
Expand Down
22 changes: 11 additions & 11 deletions fetch/p2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func forStreamingCachedUncached(

func TestP2PPeerEpochInfo(t *testing.T) {
forStreamingCachedUncached(
t, "peer error: getting ATX IDs: exec epoch 11: database: no free connection",
t, "peer error: getting ATX IDs: exec epoch 11: database closed",
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
epoch := types.EpochID(11)
atxIDs := tpf.createATXs(epoch)
Expand All @@ -291,7 +291,7 @@ func TestP2PPeerEpochInfo(t *testing.T) {

func TestP2PPeerMeshHashes(t *testing.T) {
forStreaming(
t, "peer error: get aggHashes from 7 to 23 by 5: database: no free connection", false,
t, "peer error: get aggHashes from 7 to 23 by 5: database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
req := &MeshHashRequest{
From: 7,
Expand Down Expand Up @@ -324,7 +324,7 @@ func TestP2PPeerMeshHashes(t *testing.T) {

func TestP2PMaliciousIDs(t *testing.T) {
forStreaming(
t, "database: no free connection", false,
t, "database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
var bad []types.NodeID
for i := 0; i < 11; i++ {
Expand All @@ -349,7 +349,7 @@ func TestP2PMaliciousIDs(t *testing.T) {

func TestP2PGetATXs(t *testing.T) {
forStreamingCachedUncached(
t, "database: no free connection",
t, "database closed",
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
epoch := types.EpochID(11)
atx := newAtx(tpf.t, epoch)
Expand All @@ -365,7 +365,7 @@ func TestP2PGetATXs(t *testing.T) {

func TestP2PGetPoet(t *testing.T) {
forStreaming(
t, "database: no free connection", false,
t, "database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
ref := types.PoetProofRef{0x42, 0x43}
require.NoError(t, poets.Add(tpf.serverCDB, ref, []byte("proof1"), []byte("sid1"), "rid1"))
Expand All @@ -380,7 +380,7 @@ func TestP2PGetPoet(t *testing.T) {

func TestP2PGetBallot(t *testing.T) {
forStreaming(
t, "database: no free connection", false,
t, "database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
signer, err := signing.NewEdSigner()
require.NoError(t, err)
Expand All @@ -402,7 +402,7 @@ func TestP2PGetBallot(t *testing.T) {

func TestP2PGetActiveSet(t *testing.T) {
forStreamingCachedUncached(
t, "database: no free connection",
t, "database closed",
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
id := types.RandomHash()
set := &types.EpochActiveSet{
Expand All @@ -421,7 +421,7 @@ func TestP2PGetActiveSet(t *testing.T) {

func TestP2PGetBlock(t *testing.T) {
forStreaming(
t, "database: no free connection", false,
t, "database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
lid := types.LayerID(111)
bk := types.NewExistingBlock(types.RandomBlockID(), types.InnerBlock{LayerIndex: lid})
Expand Down Expand Up @@ -472,7 +472,7 @@ func TestP2PGetProp(t *testing.T) {

func TestP2PGetBlockTransactions(t *testing.T) {
forStreaming(
t, "database: no free connection", false,
t, "database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
signer, err := signing.NewEdSigner()
require.NoError(t, err)
Expand All @@ -488,7 +488,7 @@ func TestP2PGetBlockTransactions(t *testing.T) {

func TestP2PGetProposalTransactions(t *testing.T) {
forStreaming(
t, "database: no free connection", false,
t, "database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
signer, err := signing.NewEdSigner()
require.NoError(t, err)
Expand All @@ -506,7 +506,7 @@ func TestP2PGetProposalTransactions(t *testing.T) {

func TestP2PGetMalfeasanceProofs(t *testing.T) {
forStreaming(
t, "database: no free connection", false,
t, "database closed", false,
func(t *testing.T, ctx context.Context, tpf *testP2PFetch, errStr string) {
nid := types.RandomNodeID()
proof := types.RandomBytes(11)
Expand Down

0 comments on commit 9dcdd59

Please sign in to comment.