go-waku/waku/metrics/http_test.go

22 lines
332 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"
)
func TestStartAndStopMetricsServer(t *testing.T) {
server := NewMetricsServer("0.0.0.0", 9876)
go func() {
time.Sleep(1 * time.Second)
err := server.Stop(context.Background())
require.NoError(t, err)
}()
server.Start()
}