You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: input_socket_server_test.go
    path of file: ./repos/benthos/internal/impl/io
    
    the code of the file until where you have to start completion: package io_test

import (
	"context"
	"crypto/tls"
	"errors"
	"fmt"
	"net"
	"path/filepath"
	"sort"
	"sync"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/benthosdev/benthos/v4/internal/component/cache"
	"github.com/benthosd
    
func TestTCPSocketServerMultipartShutdown(t *testing.T) {
	ctx, done := context.WithTimeout(context.Background(), time.Second*20)
	defer done()

	rdr, addr := socketServerInputFromConf(t, `
socket_server:
  network: tcp
  address: 127.0.0.1:0
  codec: lines/multipart
`)

	defer func() {
		rdr.TriggerStopConsuming()
		assert.NoError(t, rdr.WaitForClose(ctx))
	}()

	conn, err := net.Dial("tcp", addr)
	require.NoError(t, err)

	wg := sync.WaitGroup{}
	wg.Add(1)
	go func() {
		_ = conn.SetWriteDeadline(time.Now().Add(time.Second * 5))

		_, cerr := conn.Write([]byte("foo\n"))
		require.NoError(t, cerr)

		_, cerr = conn.Write([]byte("bar\n"))
		require.NoError(t, cerr)

		_, cerr = conn.Write([]byte("\n"))
		require.NoError(t, cerr)

		_, cerr = conn.Write([]byte("baz\n"))
		require.NoError(t, cerr)

		conn.Close()
		wg.Done()
	}()

	readNextMsg := func() (message.Batch, error) {
		var tran message.Transaction
		select {
		case tran = <-rdr.TransactionChan():
			require.NoError(t, tran.Ack(ctx, nil))
		case <-time.After(time.Second):
			return nil, errors.New("timed out")
		}
		return tran.Payload, nil
	}

	exp := [][]byte{[]byte("foo"), []byte("bar")}
	msg, err := readNextMsg()
	require.NoError(t, err)
	assert.Equal(t, exp, message.GetAllBytes(msg))

	exp = [][]byte{[]byte("baz")}
	msg, err = readNextMsg()
	require.NoError(t, err)
	assert.Equal(t, exp, message.GetAllBytes(msg))

	wg.Wait()
}