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: proc_disconnect_test.go
    path of file: ./repos/goka/systemtest
    
    the code of the file until where you have to start completion: package systemtest

import (
	"context"
	"fmt"
	"io"
	"log"
	"testing"
	"time"

	"github.com/lovoo/goka"
	"github.com/lovoo/goka/codec"
	"github.com/lovoo/goka/multierr"
	"github.com/stretchr/testify/require"
)

func TestProcessorShutdown_KafkaDisconnect(t *testing.T) {
	brokers := initSystemTest(t)
	var (
		topic = goka.Stream(fmt.Sprintf("goka_systemtest_proc_shutdown_disconnect-%d", time.Now().Unix()))
		group = goka.Group(topic)
	)

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	errg, ctx := multierr.NewErrGroup(ctx)

	tmgr, err := goka.DefaultTopicManagerBuilder(brokers)
	require.NoError(t, err)
	require.NoError(t, tmgr.EnsureStreamExists(string(topic), 10))

	// emit values
	errg.Go(func() error {
		em, err := goka.NewEmitter(brokers, topic, new(codec.Int64))
		require.NoError(t, err)
		defer em.Finish()
		var i int64
		for {
			select {
			case <-ctx.Done():
				return nil
			default:
			}

			prom, err := em.Emit(fmt.Sprintf("key-%d", i%20), i)
			require.NoError(t, err)
			prom.Then(func(err error) {
				require.NoError(t, err)
			})
			time.Sleep(100 * time.Millisecond)
			i++
		}
	})

	cfg := goka.DefaultConfig()

	fi := NewFIProxy()
	cfg.Net.Proxy.Enable = true
	cfg.Net.Proxy.Dialer = fi

	proc, err := goka.NewProcessor(brokers,
		goka.DefineGroup(
			group,
			goka.Input(topic, new(codec.Int64), func(ctx goka.Context, msg interface{}) {
				if val := ctx.Value(); val != nil {
					ctx.SetValue(val.(int64) + msg.(int64))
				} else {
					ctx.SetValue(msg)
				}
			}),
			goka.Persist(new(codec.Int64)),
		),
		goka.WithConsumerGroupBuilder(goka.ConsumerGroupBuilderWithConfig(cfg)),
		goka
    
func TestProcessorShutdown_KafkaDisconnect(t *testing.T) {
	brokers := initSystemTest(t)
	var (
		topic = goka.Stream(fmt.Sprintf("goka_systemtest_proc_shutdown_disconnect-%d", time.Now().Unix()))
		group = goka.Group(topic)
	)

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	errg, ctx := multierr.NewErrGroup(ctx)

	tmgr, err := goka.DefaultTopicManagerBuilder(brokers)
	require.NoError(t, err)
	require.NoError(t, tmgr.EnsureStreamExists(string(topic), 10))

	// emit values
	errg.Go(func() error {
		em, err := goka.NewEmitter(brokers, topic, new(codec.Int64))
		require.NoError(t, err)
		defer em.Finish()
		var i int64
		for {
			select {
			case <-ctx.Done():
				return nil
			default:
			}

			prom, err := em.Emit(fmt.Sprintf("key-%d", i%20), i)
			require.NoError(t, err)
			prom.Then(func(err error) {
				require.NoError(t, err)
			})
			time.Sleep(100 * time.Millisecond)
			i++
		}
	})

	cfg := goka.DefaultConfig()

	fi := NewFIProxy()
	cfg.Net.Proxy.Enable = true
	cfg.Net.Proxy.Dialer = fi

	proc, err := goka.NewProcessor(brokers,
		goka.DefineGroup(
			group,
			goka.Input(topic, new(codec.Int64), func(ctx goka.Context, msg interface{}) {
				if val := ctx.Value(); val != nil {
					ctx.SetValue(val.(int64) + msg.(int64))
				} else {
					ctx.SetValue(msg)
				}
			}),
			goka.Persist(new(codec.Int64)),
		),
		goka.WithConsumerGroupBuilder(goka.ConsumerGroupBuilderWithConfig(cfg)),
		goka.WithProducerBuilder(goka.ProducerBuilderWithConfig(cfg)),
		goka.WithConsumerSaramaBuilder(goka.SaramaConsumerBuilderWithConfig(cfg)),
	)
	require.NoError(t, err)

	errg.Go(func() error {
		return proc.Run(ctx)
	})
	pollTimed(t, "proc running", proc.Recovered, func() bool {
		if val, _ := proc.Get("key-15"); val != nil && val.(int64) > 0 {
			return true
		}
		return false
	})

	log.Printf("disconnecting consumer-group")
	fi.SetReadError(io.EOF)
	fi.SetWriteError(io.ErrClosedPipe)
	err = errg.Wait().ErrorOrNil()

	require.Error(t, err)
}