reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 44 forks source link

cli: duration of stopped workflows is not displayed correctly #699

Closed giuseppe-steduto closed 4 months ago

giuseppe-steduto commented 5 months ago

Similarly to what was happening in reanahub/reana-ui#386, when running reana-client status --include-duration for a stopped workflow, the displayed duration is not the time between the moment in which the run was started and the moment in which the run was stopped, but the total time passed from the beginning of the run until the current moment.

❯ reana-client status -w recast --include-duration --json | jq '.[0].status'
"stopped"
❯ reana-client status -w recast --include-duration --json | jq '.[0].duration'
2598
# After a few seconds...
❯ reana-client status -w recast --include-duration --json | jq '.[0].duration'
2604

This is very likely because in reana_client.utils.get_workflow_duration we only look at run_finished_at, but not at run_stopped_at.