如何解决无法运行仪表测试 - 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 中提出了一张票。不幸运,因为到目前为止没有回应。这个问题让我发疯...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。