Parallel "--by pool" not working, hanging and spamming startup banner

未关闭
#5,503 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
领域
testing-qa

调研方向

从链接文档中描述的动态测试池模式开始,跟踪 _finishRun() 周围的 worker 生命周期。使用 Puppeteer 重现挂起问题,并验证 worker 能够干净地退出,且启动横幅只输出一次,而不是每次分配测试时都输出。

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

描述

stale

We have historically suffered from idle workers due to the wide range of test duration, so when I saw the --by pool mode I thought we'd be able to speed up our tests for free basically ;) (ref: https://codecept.io/parallel/#dynamic-test-pooling-mode)

But it seems to not be working as expected. A couple of issues I noticed:

  1. When I run with pool mode it seems to just hang after a certain amount of time without any clear reason why.

We're using Puppeteer, and my suspicion is that the browser's WebSocket connection keeps the Node event loop alive in the worker thread after the port is closed, so the parent never sees the worker exit and _finishRun() never gets called.

  1. Also, the startup message is fired every time a worker takes a test, so the output gets absolutely hammered which is not ideal for CI

e.g. (example output)

CodeceptJS v3.7.7 #StandWithUkraine
Running tests in 1 workers...

CodeceptJS v3.7.7 #StandWithUkraine
Using test root "/home/user/project"

Login suite --
[Worker 01]   ✔ Login suite › User can log in in 3401ms
  ✔ User can log in in 3401ms

  OK  | 1 passed   // 4s
CodeceptJS v3.7.7 #StandWithUkraine
Using test root "/home/user/project"

Login suite --
[Worker 01]   ✔ Login suite › User sees error on bad credentials in 2980ms
  ✔ User sees error on bad credentials in 2980ms

  OK  | 2 passed   // 8s
CodeceptJS v3.7.7 #StandWithUkraine
Using test root "/home/user/project"
...
主要语言
JavaScript
星标
4.2k
派生
756
平均合并
2 天 9 小时
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codeceptjs/CodeceptJS 的其他 Issue

查看 codeceptjs/CodeceptJS 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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