code: func StartServer(t testing.TB, frontend bool, debug bool, svType string, port int, sdPrefix string, grpc bool) func() {
  	grpcPort := GetFreePort(t)
  	promPort := GetFreePort(t)
  	var useGRPC string
  	if grpc {
  		useGRPC = "true"
  	} else {
  		useGRPC = "false"
  	}
  	t.Helper()
  	args := []string{
  		"-type",
  		svType,
  		"-port",
  		strconv.Itoa(port),
  		fmt.Sprintf("-frontend=%s", strconv.FormatBool(frontend)),
  		"-sdprefix", sdPrefix,
  		"-grpcport", fmt.Sprintf("%d", grpcPort),
  		fmt.Sprintf("-grpc=%s", useGRPC),
  	}
  	if debug {
  		args = append(args, "-debug")
  	}
  	cmd := StartProcess(
  		t,
  		"../examples/testing/server",
  		args...,
  	)
  	// always use a random port for prometheus, for avoiding e2e conflicts
  	cmd.Env = []string{fmt.Sprintf("PITAYA_METRICS_PROMETHEUS_PORT=%d", promPort)}
  
  	outPipe, err := cmd.StderrPipe()
  	if err != nil {
  		t.Fatal(err)
  	}
  
  	err = cmd.Start()
  	if err != nil {
  		t.Fatal(err)
  	}
  
  	waitForServerToBeReady(t, bufio.NewReader(outPipe))
  
  	return func() {
  		err := cmd.Process.Kill()
  		if err != nil {
  			t.Fatal(err)
  		}
  	}
  }
docs: // StartServer starts a server