ignore_response
完全跳过对响应状态码和响应体的检查。
语法
--- ignore_response 段告诉框架不要检查响应的状态码和响应体。常用于测试错误场景,此时你只关心错误日志而非响应本身。
perl
1=== TEST 1: only check error log2--- config3 location /t {4 proxy_pass http://127.0.0.1:62345;5 }6--- request7GET /t8--- ignore_response9--- error_log10connect() failed当上游服务返回非法响应或连接失败时,使用 ignore_response 配合 error_log 断言是最可靠的方式。