Codeception / Codeception/module-webdriver

Default timeouts are set to zero, instead of 30 seconds

未关闭
#16 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
39
派生
25
PR 合并指标
30 天内没有已合并 PR

描述

Hey Guys,

Here https://codeception.com/docs/modules/WebDriver Codeception claims, that default timeouts (`connection_timeout` and `request_timeout`) are 30 seconds. Because of the bug, I think they are set to 0 now, which makes curl_exec() later to wait indefinitely.

Check this code https://github.com/Codeception/module-webdriver/blob/master/src/Codeception/Module/WebDriver.php#L362
```
$this->connectionTimeoutInMs = $this->config['connection_timeout'] * 1000;
$this->requestTimeoutInMs = $this->config['request_timeout'] * 1000;
```
by default both values are `null`, but multipling `null * 1000` results in `0`, not `null`. Later here https://github.com/php-webdriver/php-webdriver/blob/main/lib/Remote/RemoteWebDriver.php#L101 it is strictly compared with `null`, but since the value is `0` it passes the condition and sets timeout to `0` which makes curl to wait indefinitely.

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 src/Codeception/Module/WebDriver.php 约第 362 行开始,检查 connection_timeout 和 request_timeout 的默认值是如何转换的。将该行为与文档中说明的 30 秒默认值,以及 php-webdriver 的 lib/Remote/RemoteWebDriver.php 约第 101 行处的 null 检查进行比较。完成的标准是,省略的超时设置不再变为零,也不会导致 curl_exec() 无限期等待。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
testing-qa
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。