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: type_stream_test.go
    path of file: ./repos/benthos/internal/manager
    
    the code of the file until where you have to start completion: package manager_test

import (
	"context"
	"testing"
	"time"

	_ "github.com/benthosdev/benthos/v4/public/components/pure"
	"github.com/benthosdev/benthos/v4/public/service"

	"github.com/stretchr/testify/as
    
func TestManagerStreamPipelines(t *testing.T) {
	for _, test := range []struct {
		name     string
		conf     string
		closeErr string
	}{
		{
			name: "basic pipeline all resource types",
			conf: `
input:
  resource: fooinput

pipeline:
  processors:
    - rate_limit:
        resource: fooratelimit
    - resource: fooproc

output:
  resource: foooutput

input_resources:
  - label: fooinput
    generate:
      interval: 1ms
      mapping: |
        meta = {"foo":"foo value","bar":"bar value"}
        root.id = uuid_v4()

processor_resources:
  - label: fooproc
    cache:
      operator: set
      resource: foocache
      key: fookey
      value: '${! this.id }'

cache_resources:
  - label: foocache
    memory: {}

rate_limit_resources:
  - label: fooratelimit
    local:
      count: 10
      interval: 1s

output_resources:
  - label: foooutput
    drop: {}
`,
		},
	} {
		test := test
		t.Run(test.name, func(t *testing.T) {
			builder := service.NewStreamBuilder()
			require.NoError(t, builder.SetYAML(test.conf))
			require.NoError(t, builder.SetLoggerYAML(`level: none`))

			strm, err := builder.Build()
			require.NoError(t, err)

			cancelledCtx, done := context.WithCancel(context.Background())
			done()

			assert.Equal(t, cancelledCtx.Err(), strm.Run(cancelledCtx))

			stopErr := strm.StopWithin(time.Millisecond * 100)
			if test.closeErr == "" {
				require.NoError(t, stopErr)
			} else {
				require.Error(t, stopErr)
				assert.ErrorContains(t, stopErr, test.closeErr)
			}
		})
	}
}