step.duration reflects only the last retry attempt (HelperStep.run() overwrites startTime)
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, nodejs, playwright
Línea de trabajo
Empieza por lib/step/helper.js y lib/step/func.js, donde run() restablece startTime, y luego compara su comportamiento con la condición de protección en lib/step/record.js. Comprueba cómo se calcula duration en lib/step/base.js y busca pruebas de reintentos existentes. El trabajo está terminado cuando la duración abarca desde el primer intento hasta el éxito o el fallo final.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- JavaScript
- Estrellas
- 4.2k
- Forks
- 754
- Merge medio
- 2 d 11 h
- PR fusionados (30 d)
- 33
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codeceptjs/CodeceptJS
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
codeceptjs/CodeceptJS#5773 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)Posiblemente ocupada @danielrentz la tomó hace 274 días. Abiertostale
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#5420 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
codeceptjs/CodeceptJS#4958 · 10 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 2 días
-
stale
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#4778 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#5772 ·
Los mantenedores suelen responder en 2 días
Todos los issues de codeceptjs/CodeceptJS
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
solana-foundation/solana-web3.js#4015 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
gramps-project/gramps-web#1604 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue hacktoberfest help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
BinaryBaconLabs/todo-app#18 ·
-
Cache airport lookupsAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
sutantyo/flight-watch#32 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día