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: roundtripper_test.go
    path of file: ./repos/gitlabhq/workhorse/internal/badgateway
    
    the code of the file until where you have to start completion: package badgateway

import (
	"context"
	"errors"
	"io"
	"net/http"
	"net/http/httptest"
	"testing"

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

type roundtrip502 struct{}

func (roundtrip502) RoundTrip(*http.Request) (*http.Response, error) {
	return nil, errors.
    
func TestClientDisconnect499(t *testing.T) {
	serverSync := make(chan struct{})
	ts := httptest.NewServer(http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
		serverSync <- struct{}{}
		<-serverSync
	}))
	defer func() {
		close(serverSync)
		ts.Close()
	}()

	clientResponse := make(chan *http.Response)
	clientContext, clientCancel := context.WithCancel(context.Background())

	go func() {
		req, err := http.NewRequestWithContext(clientContext, "GET", ts.URL, nil)
		require.NoError(t, err, "build request")

		rt := NewRoundTripper(false, http.DefaultTransport)
		response, err := rt.RoundTrip(req)
		require.NoError(t, err, "perform roundtrip")
		require.NoError(t, response.Body.Close())

		clientResponse <- response
	}()

	<-serverSync

	clientCancel()
	response := <-clientResponse
	require.Equal(t, 499, response.StatusCode, "response status")
}