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

import (
	"crypto/rand"
	"encoding/hex"
	"strings"
	"testing"
	"time"

	"github.com/IBM/sarama"
	"github.com/lovoo/goka"
	"github.com/stretchr/testif
    
func TestTopicManager_v11(t *testing.T) {
	brokers := initSystemTest(t)

	cfg := sarama.NewConfig()
	cfg.Version = sarama.V0_11_0_0
	tmc := goka.NewTopicManagerConfig()
	tmc.Table.Replication = 1
	tmc.MismatchBehavior = goka.TMConfigMismatchBehaviorFail

	tm, err := goka.TopicManagerBuilderWithConfig(cfg, tmc)(brokers)
	require.NoError(t, err)

	client, _ := sarama.NewClient(brokers, cfg)
	admin, _ := sarama.NewClusterAdminFromClient(client)

	t.Run("ensure-new-stream", func(t *testing.T) {
		topic := newTopicName()

		// delete topic, ignore error if it does not exist
		admin.DeleteTopic(topic)

		err := tm.EnsureStreamExists(topic, 10)
		require.NoError(t, err)
		time.Sleep(1 * time.Second)
		// trying to create the same is fine
		err = tm.EnsureStreamExists(topic, 10)
		require.NoError(t, err)
		time.Sleep(1 * time.Second)
		// partitions changed - error
		err = tm.EnsureStreamExists(topic, 11)
		require.Error(t, err)
	})

	t.Run("list-partitions", func(t *testing.T) {
		var (
			topic      = newTopicName()
			partitions []int32
			err        error
		)
		_, err = tm.Partitions(topic)
		require.Error(t, err)
		require.True(t, strings.Contains(err.Error(), "requested topic was not found"))
		require.Equal(t, 0, len(partitions))

		tm.EnsureTableExists(topic, 123)
		time.Sleep(1 * time.Second)
		partitions, err = tm.Partitions(topic)
		require.NoError(t, err)
		require.Equal(t, 123, len(partitions))
	})

	t.Run("non-existent", func(t *testing.T) {
		// topic does not exist
		partitions, err := tm.Partitions("non-existent-topic")
		require.True(t, len(partitions) == 0, "expected no partitions, was", partitions)
		require.Error(t, err)
	})
}