无法运行仪表测试 - connectex:无法建立连接,因为目标机器主动拒绝它

问题描述

我正在使用 Gauge 和 python 开发一些测试,但在运行规范时出现连接错误,我检查了 Gauge 错误并发现 grpc 在 65271 上打开连接,并且端口 65268 引发错误

我是否遗漏了什么(这是我的第一次尝试)?

19-01-2021 17:20:38.022 [python] [INFO] Python: 3.9.0
19-01-2021 17:20:38.022 [python] [DEBUG] Loading step implementations from C:\workspace\test_gauge\step_impl dirs.
19-01-2021 17:20:38.061 [python] [DEBUG] Starting grpc server..
19-01-2021 17:20:38.066 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 65268
19-01-2021 17:20:38.067 [Gauge] [DEBUG] Successfully made the connection with runner with port: 65268
19-01-2021 17:20:38.067 [Gauge] [DEBUG] Validation started.
19-01-2021 17:20:38.075 [Gauge] [DEBUG] Validation completed.
19-01-2021 17:20:38.075 [Gauge] [DEBUG] Run started
19-01-2021 17:20:38.076 [Gauge] [DEBUG] Starting Html Report plugin
19-01-2021 17:20:38.083 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,java,python,screenshot&o=windows&a=amd64
19-01-2021 17:20:38.103 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 65271
19-01-2021 17:20:38.103 [Gauge] [DEBUG] Successfully made the connection with plugin with port: 65271
19-01-2021 17:20:38.103 [Gauge] [DEBUG] Initialising suite data store.
19-01-2021 17:20:38.176 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/screenshot?l=python&p=html-report,screenshot&o=windows&a=amd64
19-01-2021 17:20:38.217 [python] [CRITICAL] Exception occurred while loading step implementations from file: step_impl\webui\pages\login_page.py.
19-01-2021 17:20:38.220 [Gauge] [ERROR] Error Message: transport is closing
19-01-2021 17:20:38.220 [Gauge] [ERROR] Stacktrace: 
19-01-2021 17:20:38.220 [Gauge] [ERROR] Error Message: Runner is not Alive
19-01-2021 17:20:38.220 [Gauge] [ERROR] Stacktrace: 
19-01-2021 17:20:38.221 [html-report] [DEBUG] Transformed SuiteResult to report structure
19-01-2021 17:20:38.231 [Gauge] [ERROR] Error occurred while waiting for runner process to finish.
Error : exit status 1
19-01-2021 17:20:38.251 [Gauge] [DEBUG] Sending kill message to Html Report plugin.
19-01-2021 17:20:38.251 [html-report] [INFO] Successfully generated html-report to => C:\workspace\test_gauge\reports\html-report\index.html
19-01-2021 17:20:38.251 [html-report] [DEBUG] Done generating HTML report using theme from C:\Users\imrankhan\AppData\Roaming\gauge\plugins\html-report\4.0.12\themes\default
**19-01-2021 17:20:40.221 [Gauge] [ERROR] Failed to kill Runner: rpc error: code = Unavailable desc = all SubConns are in TransientFailure,latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:65268: connectex: No connection Could be made because the target machine actively refused it."**
19-01-2021 17:20:40.221 [Gauge] [INFO] Specifications:  0 executed  0 passed    0 Failed    0 skipped
19-01-2021 17:20:40.222 [Gauge] [INFO] Scenarios:   0 executed  0 passed    0 Failed    0 skipped
19-01-2021 17:20:40.222 [Gauge] [INFO] 
Total time taken: 145ms
19-01-2021 17:20:40.224 [Gauge] [INFO] Updates are available. Run `gauge update -c` for more info.

解决方法

昨天我查看了日志并进行了大量调查,看起来这个问题的根本原因不是仪表而是我自己的脚本(我相信你也是)

注意有一个关键行“[python] [CRITICAL] 从文件加载步骤实现时发生异常:step_impl\webui\pages\login_page.py。”在您的日志中,这是一个标志,让您知道您的 Python 脚本有问题。如果你不弄清楚你的python脚本出了什么问题,这个问题就会一直存在。

从表面上看,gauge runner 阻止了要显示的 Python 脚本(和我的)的详细错误的另一个问题,这会误导我们指出gauge runner 而不是 python 脚本的根本原因。

>

简而言之,gauge runner 不会打印出 python 脚本的详细错误日志,但有。

,

我遇到了完全相同的问题,并在 github 中提出了一张票。不幸运,因为到目前为止没有回应。这个问题让我发疯...

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...