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

import (
	"context"
	"errors"
	"reflect"
	"sync"
	"sync/atomic"
	"testing"
	"time"

	"github.com/stretchr/testify/require"

	"github.com/benthosdev/benthos/v4/internal/component"
	"github.com/benthosdev/benthos/v4/internal/message"
)

ty
    
func TestAsyncWriterCantReconnect(t *testing.T) {
	t.Skip("Takes too long!")
	t.Parallel()

	writerImpl := newAsyncMockWriter()

	w, err := NewAsyncWriter("foo", 1, writerImpl, component.NoopObservability())
	if err != nil {
		t.Error(err)
		return
	}

	msgChan := make(chan message.Transaction)
	resChan := make(chan error)

	if err = w.Consume(msgChan); err != nil {
		t.Error(err)
	}

	go func() {
		select {
		case msgChan <- message.NewTransaction(message.QuickBatch(nil), resChan):
		case <-time.After(time.Second):
			t.Error("Timed out")
		}
	}()

	select {
	case writerImpl.connChan <- nil:
	case <-time.After(time.Second):
		t.Fatal("Timed out")
	}
	select {
	case writerImpl.writeChan <- component.ErrNotConnected:
	case <-time.After(time.Second):
		t.Fatal("Timed out")
	}

	select {
	case writerImpl.connChan <- component.ErrNotConnected:
	case <-time.After(time.Second):
		t.Fatal("Timed out")
	}

	// We will be failing to send but should still exit immediately.
	w.TriggerCloseNow()

	go func() {
		select {
		case writerImpl.connChan <- component.ErrNotConnected:
		case <-time.After(time.Second):
		}
	}()

	ctx, done := context.WithTimeout(context.Background(), time.Second*30)
	defer done()

	require.NoError(t, w.WaitForClose(ctx))
}