From 06a7464b42bfd8006d3eaaa56f2a6b50638d09f7 Mon Sep 17 00:00:00 2001 From: tycho garen Date: Tue, 17 Oct 2023 15:28:13 -0400 Subject: [PATCH] series: make test pass in CI --- series/series_test.go | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/series/series_test.go b/series/series_test.go index b417bfb..c3fd755 100644 --- a/series/series_test.go +++ b/series/series_test.go @@ -9,7 +9,6 @@ import ( "time" "github.com/tychoish/fun/assert" - "github.com/tychoish/fun/ft" "github.com/tychoish/grip" ) @@ -20,27 +19,31 @@ func TestIntegration(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() + sb, err := SocketBackend(CollectorBackendSocketConfWithRenderer(MakeGraphiteRenderer()), + CollectorBackendSocketConfMessageWorkers(4), + CollectorBackendSocketConfDialWorkers(6), + CollectorBackendSocketConfDialer(net.Dialer{ + Timeout: 2 * time.Second, + KeepAlive: time.Minute, + }), + CollectorBackendSocketConfNetowrkTCP(), + CollectorBackendSocketConfAddress("localhost:2003"), + CollectorBackendSocketConfMinDialRetryDelay(100*time.Millisecond), + CollectorBackendSocketConfIdleConns(6), + CollectorBackendSocketConfMaxDialRetryDelay(time.Second), + CollectorBackendSocketConfMessageErrorHandling(CollectorBackendSocketErrorAbort), + CollectorBackendSocketConfDialErrorHandling(CollectorBackendSocketErrorAbort)) + + if err != nil { + t.Fatal(err) + } + coll, err := NewCollector( ctx, CollectorConfBuffer(9001), CollectorConfAppendBackends( LoggerBackend(grip.Sender(), MakeJSONRenderer()), - ft.Must(SocketBackend( - CollectorBackendSocketConfWithRenderer(MakeGraphiteRenderer()), - CollectorBackendSocketConfMessageWorkers(4), - CollectorBackendSocketConfDialWorkers(6), - CollectorBackendSocketConfDialer(net.Dialer{ - Timeout: 2 * time.Second, - KeepAlive: time.Minute, - }), - CollectorBackendSocketConfNetowrkTCP(), - CollectorBackendSocketConfAddress("localhost:2003"), - CollectorBackendSocketConfMinDialRetryDelay(100*time.Millisecond), - CollectorBackendSocketConfIdleConns(6), - CollectorBackendSocketConfMaxDialRetryDelay(time.Second), - CollectorBackendSocketConfMessageErrorHandling(CollectorBackendSocketErrorPanic), - CollectorBackendSocketConfDialErrorHandling(CollectorBackendSocketErrorPanic)), - ), + sb, )) assert.NotError(t, err) assert.True(t, coll != nil)