Duration time of custom collapsible sections is cut down to minutes

Summary

Duration time of custom collapsible sections is cut down to minutes: e.g. if the duration time was 1h50min, it will just show 50:00.

Steps to reproduce

  • create a CI job with custom collapsible section
  • make it run more than 1h: one option to emulate it is to add sleep to the script; another way is to set some timestamp in the past instead of date +%s
  • check the duration in the job output

Example Project

https://gitlab.com/atanayno/collapsible-ci-test/-/jobs/458694496

What is the expected correct behavior?

Hours should be shown in the duration time, also potentially days should be shown

Relevant logs and/or screenshots

The duration at this screenshot was expected to be 1h15min but it shows just 15min:

duration_for_collapsible_section

Output of checks

This bug was reproduced on GitLab.com and on a test instance with GitLab 12.8.1.

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Ubuntu 16.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.5p114 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.7 Git Version: 2.24.1 Sidekiq Version:5.2.7 Go Version: unknown

GitLab information Version: 12.8.1-ee Revision: 13bae744d5c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.12 URL: https://domain.tld HTTP Clone URL: https://domain.tld/some-group/some-project.git SSH Clone URL: git@domain.tld:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 11.0.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

Possible fixes

Raw job log does not have these timings, I suppose it is handled incorrectly in https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/jobs/components/log/duration_badge.vue

Edited by 🤖 GitLab Bot 🤖