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: lightning_server_serial_test.go
    path of file: ./repos/tidb/br/pkg/lightning
    
    the code of the file until where you have to start completion: // Copyright 2021 PingCAP, Inc.
//
// Licensed under the
    
func TestRunServer(t *testing.T) {
	s := createSuite(t)

	url := "http://" + s.lightning.serverAddr.String() + "/tasks"

	resp, err := http.Post(url, "application/toml", strings.NewReader("????"))
	require.NoError(t, err)
	require.Equal(t, http.StatusNotImplemented, resp.StatusCode)
	var data map[string]string
	err = json.NewDecoder(resp.Body).Decode(&data)
	require.NoError(t, err)
	require.Contains(t, data, "error")
	require.Equal(t, "server-mode not enabled", data["error"])
	require.NoError(t, resp.Body.Close())

	go func() {
		_ = s.lightning.RunServer()
	}()
	time.Sleep(100 * time.Millisecond)

	req, err := http.NewRequest(http.MethodPut, url, nil)
	require.NoError(t, err)
	resp, err = http.DefaultClient.Do(req)
	require.NoError(t, err)
	require.Equal(t, http.StatusMethodNotAllowed, resp.StatusCode)
	require.Contains(t, resp.Header.Get("Allow"), http.MethodPost)
	require.NoError(t, resp.Body.Close())

	resp, err = http.Post(url, "application/toml", strings.NewReader("????"))
	require.NoError(t, err)
	require.Equal(t, http.StatusBadRequest, resp.StatusCode)
	err = json.NewDecoder(resp.Body).Decode(&data)
	require.NoError(t, err)
	require.Contains(t, data, "error")
	require.Regexp(t, "^cannot parse task", data["error"])
	require.NoError(t, resp.Body.Close())

	resp, err = http.Post(url, "application/toml",
		strings.NewReader("[mydumper.csv]\nseparator = 'fooo'\ndelimiter= 'foo'"))
	require.NoError(t, err)
	require.Equal(t, http.StatusBadRequest, resp.StatusCode)
	err = json.NewDecoder(resp.Body).Decode(&data)
	require.NoError(t, err)
	require.Contains(t, data, "error")
	require.Regexp(t, "^invalid task configuration:", data["error"])
	require.NoError(t, resp.Body.Close())

	for i := 0; i < 20; i++ {
		resp, err = http.Post(url, "application/toml", strings.NewReader(fmt.Sprintf(`
			[mydumper]
			data-source-dir = 'file://demo-path-%d'
			[mydumper.csv]
			separator = '/'
		`, i)))
		require.NoError(t, err)
		require.Equal(t, http.StatusOK, resp.StatusCode)
		var result map[string]int
		err = json.NewDecoder(resp.Body).Decode(&result)
		require.NoError(t, resp.Body.Close())
		require.NoError(t, err)
		require.Contains(t, result, "id")

		select {
		case taskCfg := <-s.taskCfgCh:
			require.Equal(t, "test.invalid", taskCfg.TiDB.Host)
			require.Equal(t, fmt.Sprintf("file://demo-path-%d", i), taskCfg.Mydumper.SourceDir)
			require.Equal(t, "/", taskCfg.Mydumper.CSV.Separator)
		case <-time.After(5 * time.Second):
			t.Fatalf("task is not queued after 5 seconds (i = %d)", i)
		}
	}
}