Remove metrics test

This commit is contained in:
Andrea Maria Piana 2021-07-13 07:47:58 +02:00
parent 65c9d39040
commit b30f671135
1 changed files with 0 additions and 38 deletions

View File

@ -1,38 +0,0 @@
package node
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/node"
)
func TestSubscribeServerEventsWithoutServer(t *testing.T) {
gethNode, err := node.New(&node.Config{NoUSB: true})
require.NoError(t, err)
require.EqualError(t, SubscribeServerEvents(context.TODO(), gethNode), "server is unavailable")
}
func TestSubscribeServerEvents(t *testing.T) {
gethNode, err := node.New(&node.Config{NoUSB: true})
require.NoError(t, err)
err = gethNode.Start()
require.NoError(t, err)
defer func() {
err := gethNode.Close()
require.NoError(t, err)
}()
ctx, cancel := context.WithCancel(context.Background())
done := make(chan struct{})
go func() {
err := SubscribeServerEvents(ctx, gethNode)
require.NoError(t, err)
close(done)
}()
cancel()
<-done
}