go-waku/waku/metrics/http_test.go

23 lines
393 B
Go
Raw Normal View History

2021-10-18 12:43:17 +00:00
package metrics
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/waku-org/go-waku/waku/v2/utils"
2021-10-18 12:43:17 +00:00
)
func TestStartAndStopMetricsServer(t *testing.T) {
server := NewMetricsServer("0.0.0.0", 9876, utils.Logger())
2021-10-18 12:43:17 +00:00
go func() {
time.Sleep(1 * time.Second)
err := server.Stop(context.Background())
require.NoError(t, err)
}()
server.Start()
}