doujiong2533 2019-01-10 10:54
浏览 29

Pact-Go找不到服务器正在运行

I'm trying to create a simple consumer-provider contract with Pact and Pact Broker.

The consumer is working and it's publishing the interactions to the broker as expected, but the provider is failing to when running the tests.

The error is:

--- FAIL: TestPact (10.14s)
    pact.go:270: Error: Expected server to start < 10s. Timed out waiting for Daemon on port 0 - are you
                sure it's running?

Here is the repo with the provider https://github.com/tutabeier/pact-consumer-provider/tree/master/provider

Most specifically, here is the test: https://github.com/tutabeier/pact-consumer-provider/blob/master/provider/cmd/provider/main_test.go

I have no idea what I'm doing wrong.

  • 写回答

1条回答 默认 最新

  • dongluan6784 2019-01-10 11:16
    关注

    «on port 0» — this is flat out weird: no service is ever listening on port 0, but this number is commonly used to bind a service to a port, and in this case it means the OS is asked to pick any free port and assign it to that service. One then is expected to ask the bound socket to tell it what port it ended up listening on.

    Still, the code in main_test.go uses hard-coded port numbers, and neither of them is 0.

    So I have no idea but at least tried to keep your efforts going.

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么