reanahub / reana-ui

REANA UI frontend
http://reana-ui.rtfd.io
MIT License
4 stars 33 forks source link

Time after which the workflow is stopped incorrectly updated #337

Closed giuseppe-steduto closed 1 year ago

giuseppe-steduto commented 1 year ago

The timer that usually shows the workflow duration, and that should say after how much time a workflow has been stopped doesn't pause when the workflow is stopped. This results in the "stopped after X minutes Y seconds" phrase with X and Y constantly increasing as time passes. This happens both in the timer of the workflow and in those of the jobs:

image (In this picture the workflow was stopped a few seconds after it was started, but the screenshot was taken 35 minutes later: the time kept increasing)

How to reproduce:

  1. Stop a running workflow (e.g. with the reana-client stop -w workflow --force command): the timer that was saying running for X minutes Y seconds now says stopped after X minutes Y seconds.
  2. After some minutes, the same timer will say stopped after W minutes Z seconds, constantly increasing as time passes.

This is likely due to the fact that we always calculate the duration of a workflow in the same way, regardless of the workflow (or job) status:

workflow.duration = formatDuration(
      getDuration(startedMoment, finishedMoment)
    );