From 486483c611b700a88369c9a1d66c0a7d4ac37a3d Mon Sep 17 00:00:00 2001 From: QxBytes Date: Mon, 29 Apr 2024 11:57:46 -0700 Subject: [PATCH] Revert "add close connection on telemetry unmarshal error unit test" This reverts commit e8447f9d0d2370b5c742697ffa25d1532eedbac2. --- telemetry/telemetrybuffer_test.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/telemetry/telemetrybuffer_test.go b/telemetry/telemetrybuffer_test.go index 4a2f2d6d65..c69aa04aa7 100644 --- a/telemetry/telemetrybuffer_test.go +++ b/telemetry/telemetrybuffer_test.go @@ -70,30 +70,6 @@ func TestClientConnClose(t *testing.T) { tbClient.Close() } -func TestCloseOnWriteError(t *testing.T) { - tbServer, closeTBServer := createTBServer(t) - defer closeTBServer() - - tbClient := NewTelemetryBuffer(nil) - err := tbClient.Connect() - require.NoError(t, err) - defer tbClient.Close() - - data := []byte("{\"good\":1}") - _, err = tbClient.Write(data) - require.NoError(t, err) - // need to wait for connection to populate in server - time.Sleep(1 * time.Second) - require.Len(t, tbServer.connections, 1) - - // the connection should be automatically closed on failure - badData := []byte("} malformed json }}}") - _, err = tbClient.Write(badData) - require.NoError(t, err) - time.Sleep(1 * time.Second) - require.Empty(t, tbServer.connections) -} - func TestWrite(t *testing.T) { _, closeTBServer := createTBServer(t) defer closeTBServer()