Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profile_tasks bogus time with multiple playbooks #52760

Closed
dseven opened this issue Feb 21, 2019 · 2 comments · Fixed by #53065
Closed

profile_tasks bogus time with multiple playbooks #52760

dseven opened this issue Feb 21, 2019 · 2 comments · Fixed by #53065
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team. verified This issue has been verified/reproduced by maintainer

Comments

@dseven
Copy link

dseven commented Feb 21, 2019

SUMMARY

When ansible-playbook is invoked with two playbooks, the profile_tasks reports a bogus time for the last task in the first playbook in the summary at the end. Instead of the actual time taken by that task, it reports the time since the epoch.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

profile_tasks

ANSIBLE VERSION
  config file = /tmp/atest/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Nov  1 2018, 03:12:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)]
CONFIGURATION
OS / ENVIRONMENT

EL7

STEPS TO REPRODUCE
$ cat pb1.yml 
- hosts: localhost
  tasks:
    - name: "sleep 1a"
      command: "sleep 1"
    - name: "sleep 1b"
      command: "sleep 1"
    - name: "sleep 1c"
      command: "sleep 1"
$ cat pb2.yml 
- hosts: localhost
  tasks:
    - name: "sleep 2a"
      command: "sleep 1"
    - name: "sleep 2b"
      command: "sleep 1"
    - name: "sleep 2c"
      command: "sleep 1"
$ 
EXPECTED RESULTS

"sleep 1c" in the summary should show approx 1 second (actual "1.21s" in the example below)

ACTUAL RESULTS

"sleep 1c" in the summary shows time since epoch ("1550785925.32s")

1550785919.47
$ ansible-playbook pb1.yml pb2.yml
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'


PLAY [localhost] *********************************************************************************

TASK [Gathering Facts] ***************************************************************************
Thursday 21 February 2019  21:52:01 +0000 (0:00:00.104)       0:00:00.104 ***** 
ok: [localhost]

TASK [sleep 1a] **********************************************************************************
Thursday 21 February 2019  21:52:02 +0000 (0:00:01.110)       0:00:01.215 ***** 
changed: [localhost]

TASK [sleep 1b] **********************************************************************************
Thursday 21 February 2019  21:52:04 +0000 (0:00:01.423)       0:00:02.639 ***** 
changed: [localhost]

TASK [sleep 1c] **********************************************************************************
Thursday 21 February 2019  21:52:05 +0000 (0:00:01.236)       0:00:03.875 ***** 
changed: [localhost]

PLAY RECAP ***************************************************************************************
localhost                  : ok=4    changed=3    unreachable=0    failed=0   

Thursday 21 February 2019  21:52:06 +0000 (0:00:01.205)       0:00:05.080 ***** 
=============================================================================== 
sleep 1a ---------------------------------------------------------------------------------- 1.42s
sleep 1b ---------------------------------------------------------------------------------- 1.24s
sleep 1c ---------------------------------------------------------------------------------- 1.21s
Gathering Facts --------------------------------------------------------------------------- 1.11s

PLAY [localhost] *********************************************************************************

TASK [Gathering Facts] ***************************************************************************
Thursday 21 February 2019  21:52:06 +0000 (0:00:00.065)       0:00:05.145 ***** 
ok: [localhost]

TASK [sleep 2a] **********************************************************************************
Thursday 21 February 2019  21:52:07 +0000 (0:00:00.629)       0:00:05.775 ***** 
changed: [localhost]

TASK [sleep 2b] **********************************************************************************
Thursday 21 February 2019  21:52:08 +0000 (0:00:01.237)       0:00:07.013 ***** 
changed: [localhost]

TASK [sleep 2c] **********************************************************************************
Thursday 21 February 2019  21:52:09 +0000 (0:00:01.235)       0:00:08.248 ***** 
changed: [localhost]

PLAY RECAP ***************************************************************************************
localhost                  : ok=8    changed=6    unreachable=0    failed=0   

Thursday 21 February 2019  21:52:10 +0000 (0:00:01.203)       0:00:09.452 ***** 
=============================================================================== 
sleep 1c ------------------------------------------------------------------------------- 1550785925.32s
sleep 1a ---------------------------------------------------------------------------------- 1.42s
sleep 2a ---------------------------------------------------------------------------------- 1.24s
sleep 1b ---------------------------------------------------------------------------------- 1.24s
sleep 2b ---------------------------------------------------------------------------------- 1.24s
sleep 2c ---------------------------------------------------------------------------------- 1.20s
Gathering Facts --------------------------------------------------------------------------- 1.11s
Gathering Facts --------------------------------------------------------------------------- 0.63s
$ 
@ansibot
Copy link
Contributor

ansibot commented Feb 21, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 21, 2019
@samdoran samdoran added the verified This issue has been verified/reproduced by maintainer label Feb 22, 2019
@samdoran
Copy link
Contributor

Verified this is still the case in devel.

@bcoca bcoca added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Feb 26, 2019
mkrizek added a commit to mkrizek/ansible that referenced this issue Feb 27, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team. verified This issue has been verified/reproduced by maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants