Skip to content

Commit debe38c

Browse files
CodeCasterXclaude
andcommitted
fix: Remove problematic server connectivity check from test script
Remove the complex server connectivity check that was causing HTTP handler not found errors. The script now directly proceeds to actual testing, which will naturally fail with clear error messages if the server is not running. Changes: - Replaced check_server() with simple show_server_info() function - Removed all network probing logic (nc, telnet, curl connectivity tests) - Simplified startup - script now shows server info and proceeds to tests - Tests themselves will indicate if server is unreachable with clearer errors This approach is more reliable and avoids accessing non-existent endpoints that trigger HttpHandlerNotFoundException in the server logs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4206df2 commit debe38c

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

examples/fit-example/07-http-client-proxy/run_tests.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,10 @@ log_warning() {
9898
echo -e "${YELLOW}[WARN]${NC} $1"
9999
}
100100

101-
# 检查服务器是否运行
102-
check_server() {
103-
log_info "检查服务器连接..."
104-
# 使用一个实际存在的端点来检查服务器
105-
local test_endpoint="$BASE_URL/bearer-static"
106-
if curl -s --connect-timeout 5 -I "$test_endpoint" > /dev/null 2>&1; then
107-
log_success "服务器连接正常"
108-
else
109-
log_error "无法连接到服务器 $BASE_URL"
110-
log_info "请确保服务器已启动:mvn spring-boot:run -pl plugin-http-server"
111-
exit 1
112-
fi
101+
# 显示服务器信息(不进行连接检查)
102+
show_server_info() {
103+
log_info "目标服务器: $BASE_URL"
104+
log_info "如果测试失败,请确保服务器已启动:mvn spring-boot:run -pl plugin-http-server"
113105
}
114106

115107
# 执行单个测试
@@ -249,8 +241,8 @@ main() {
249241
echo "详细模式: $VERBOSE"
250242
echo "=========================================="
251243

252-
# 检查服务器
253-
check_server
244+
# 显示服务器信息
245+
show_server_info
254246

255247
# 统计变量
256248
local total_tests=0

0 commit comments

Comments
 (0)