step.duration reflects only the last retry attempt (HelperStep.run() overwrites startTime)
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, nodejs, playwright
調査の方向性
lib/step/helper.js と lib/step/func.js から始め、run() が startTime をリセットする箇所を確認してから、lib/step/record.js のガードとの動作を比較してください。lib/step/base.js で duration がどのように計算されるかを確認し、既存のリトライテストを探してください。作業完了の条件は、duration が最初の試行から最終的な成功または失敗までの時間をカバーすることです。
索引モデルが issue の本文から書いたものです。
説明
What happens
When a helper step is retried (e.g. by the retryFailedStep plugin), step.duration covers only the last attempt instead of the whole step.
In our run, a I.click(...) step was retried for ~50 seconds before it finally failed. The HTML report (@testomatio/reporter, which shows step.duration) listed it as 3ms, while the scenario took 49s 697ms.
Cause
lib/step/record.js deliberately keeps the start time of the first attempt:
() => {
if (!step.startTime) {
// step can be retries
event.emit(event.step.started, step)
step.startTime = +Date.now()
}
return (val = step.run(...args))
},
But HelperStep.run() in lib/step/helper.js overwrites it on every attempt:
run() {
this.args = Array.prototype.slice.call(arguments)
this.startTime = +Date.now()
...
So duration (endTime - startTime in lib/step/base.js) is measured from the start of the last retry. FuncStep.run() in lib/step/func.js has the same assignment.
Expected
step.duration covers all attempts, from the first start to the final pass or failure, as the guard in record.js intends. A possible fix is to set startTime in run() only when it isn't already set.
Steps to reproduce
- Enable
retryFailedStep. - Run a step that fails for a while and is retried, e.g.
I.click()on an element that never shows up. - Read
step.durationin anevent.step.finishedlistener, or look at the step time in any reporter that uses it. It shows only the last attempt's duration (a few ms).
Environment
- CodeceptJS 4.2.2 (also present on current
main) - Playwright helper, Bun runtime
Created by AI agent (Claude Code)
- 主要言語
- JavaScript
- スター
- 4.2k
- フォーク
- 754
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codeceptjs/CodeceptJS のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
codeceptjs/CodeceptJS#5773 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)対応中かも @danielrentz が 274 日前に担当しました。 オープンstale
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
codeceptjs/CodeceptJS#5420 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
stale
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
codeceptjs/CodeceptJS#4958 · コメント 10 件 · リアクション 2 件 ·
メンテナーはふだん 2 日以内に返信
-
stale
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
codeceptjs/CodeceptJS#4778 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
codeceptjs/CodeceptJS#5772 ·
メンテナーはふだん 2 日以内に返信
codeceptjs/CodeceptJS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mailgun/mailgun.js#544 ·
-
beginner bug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
BistaDinesh03/critique#266 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
solana-foundation/solana-web3.js#4015 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: dependencies auto-generated cwe: 405 dependencies ecosystem: npm help wanted package: minimatch scope: runtime security security-alert severity: medium source: dependabot supply-chain vulnerability
難易度 2/5 半日 初心者へのやさしさ 65/100
tdk-landscape/tdk-cli-core#2811 ·
-
a11y bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-webui/open-webui#33442 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信