PactBroker throws java.net.ConnectException: Operation timed out (连接超时)
PactBroker throws java.net.ConnectException: Operation timed out (Connection timed out)
我在 https://mytestbroker.com 托管了一个契约代理服务器。我可以浏览经纪人页面。
当我运行mvn test
时,合同测试失败并出现连接超时错误。
curl -i https://mytestbroker.com
HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=utf-8
Date: Wed, 06 Jan 2021 03:40:58 GMT
Server: nginx/1.13.12
Status: 200 OK
X-Content-Type-Options: nosniff
X-Pact-Broker-Version: 2.29.0
X-Powered-By: Phusion Passenger 6.0.2
Content-Length: 2648
Connection: keep-alive
@PactBroker(host = "mytestbroker.com", scheme = "https", consumers = {"my-api"})
@Provider("backend1")
public class MyContractTest {
@State("do some action")
public void testBackendService1() {
}
}
org.apache.http.conn.HttpHostConnectException: Connect to mytestbroker.com:443 [mytestbroker.com/2.2.2.2, mytestbroker.com/5.5.5.5] failed: Operation timed out (Connection timed out)
Caused by: java.net.ConnectException: Operation timed out (Connection timed out)
该错误似乎与 Pact 无关,更多与网络有关。
经纪人是否可以公开访问?测试本身如何运行? cURL 知道 Java 进程不知道的它们的中间代理吗?
您应该启用调试级别日志记录以查看 Pact 看到的内容。
我在 https://mytestbroker.com 托管了一个契约代理服务器。我可以浏览经纪人页面。
当我运行mvn test
时,合同测试失败并出现连接超时错误。
curl -i https://mytestbroker.com
HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=utf-8
Date: Wed, 06 Jan 2021 03:40:58 GMT
Server: nginx/1.13.12
Status: 200 OK
X-Content-Type-Options: nosniff
X-Pact-Broker-Version: 2.29.0
X-Powered-By: Phusion Passenger 6.0.2
Content-Length: 2648
Connection: keep-alive
@PactBroker(host = "mytestbroker.com", scheme = "https", consumers = {"my-api"})
@Provider("backend1")
public class MyContractTest {
@State("do some action")
public void testBackendService1() {
}
}
org.apache.http.conn.HttpHostConnectException: Connect to mytestbroker.com:443 [mytestbroker.com/2.2.2.2, mytestbroker.com/5.5.5.5] failed: Operation timed out (Connection timed out)
Caused by: java.net.ConnectException: Operation timed out (Connection timed out)
该错误似乎与 Pact 无关,更多与网络有关。
经纪人是否可以公开访问?测试本身如何运行? cURL 知道 Java 进程不知道的它们的中间代理吗?
您应该启用调试级别日志记录以查看 Pact 看到的内容。