refactor(entrypoint): streamline benchmark tests and enhance error handling

- Introduced `NewTestRoute` function to simplify route creation in benchmark tests.
- Replaced direct route validation and starting with error handling using `require.NoError`.
- Updated server retrieval to use `common.ProxyHTTPAddr` for consistency.
- Improved logging for HTTP route addition errors in `AddRoute` method.
This commit is contained in:
yusing
2026-02-06 15:38:22 +08:00
parent ad59ddb9d8
commit 9abe948d1d
4 changed files with 52 additions and 43 deletions

View File

@@ -126,10 +126,6 @@ func (ep *Entrypoint) GetServer(addr string) (http.Handler, bool) {
return ep.servers.Load(addr)
}
func (ep *Entrypoint) PrintServers() {
log.Info().Msgf("servers: %v", xsync.ToPlainMap(ep.servers))
}
func (ep *Entrypoint) SetFindRouteDomains(domains []string) {
if len(domains) == 0 {
ep.findRouteFunc = findRouteAnyDomain