race condition in tripleoclient unit tests

Bug #1945660 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Unassigned

Bug Description

We're seeing random failures in the py3x jobs for tripleoclient. Looks like there's a race condition where the /tmp/ansible-playbook-command.sh goes missing. This is likely due to a missing mock or bad tests.

2021-09-30 07:36:12.619177 | ubuntu-bionic | tripleoclient.tests.test_utils.TestRunAnsiblePlaybook.test_run_with_extravar_file
2021-09-30 07:36:12.619189 | ubuntu-bionic | ---------------------------------------------------------------------------------
2021-09-30 07:36:12.619202 | ubuntu-bionic |
2021-09-30 07:36:12.619214 | ubuntu-bionic | Captured traceback:
2021-09-30 07:36:12.619226 | ubuntu-bionic | ~~~~~~~~~~~~~~~~~~~
2021-09-30 07:36:12.619238 | ubuntu-bionic | Traceback (most recent call last):
2021-09-30 07:36:12.619251 | ubuntu-bionic |
2021-09-30 07:36:12.619263 | ubuntu-bionic | File "/home/zuul/src/opendev.org/openstack/python-tripleoclient/.tox/py37/lib/python3.7/site-packages/mock/mock.py", line 1346, in patched
2021-09-30 07:36:12.619279 | ubuntu-bionic | return func(*newargs, **newkeywargs)
2021-09-30 07:36:12.619292 | ubuntu-bionic |
2021-09-30 07:36:12.619305 | ubuntu-bionic | File "/home/zuul/src/opendev.org/openstack/python-tripleoclient/tripleoclient/tests/test_utils.py", line 246, in test_run_with_extravar_file
2021-09-30 07:36:12.619318 | ubuntu-bionic | 'num': 42
2021-09-30 07:36:12.619330 | ubuntu-bionic |
2021-09-30 07:36:12.619343 | ubuntu-bionic | File "/home/zuul/src/opendev.org/openstack/python-tripleoclient/tripleoclient/utils.py", line 686, in run_ansible_playbook
2021-09-30 07:36:12.619356 | ubuntu-bionic | os.chmod(command_path, 0o750)
2021-09-30 07:36:12.619368 | ubuntu-bionic |
2021-09-30 07:36:12.619380 | ubuntu-bionic | FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ansible-playbook-command.sh'
2021-09-30 07:36:12.619392 | ubuntu-bionic |

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)
Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-tripleoclient/+/811984
Committed: https://opendev.org/openstack/python-tripleoclient/commit/d5457bfb4ea02e92160f4356b515303c1a861f9c
Submitter: "Zuul (22348)"
Branch: master

commit d5457bfb4ea02e92160f4356b515303c1a861f9c
Author: Alex Schultz <email address hidden>
Date: Thu Sep 30 08:46:04 2021 -0600

    Use real tmpdir for ansible runner tests

    Additionally mock os.chmod in case the file does not exist.

    Change-Id: I404391c0c755681831c33ec7bc752b5d7878ed85
    Closes-Bug: #1945660

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/python-tripleoclient/+/812192

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/python-tripleoclient/+/812192
Committed: https://opendev.org/openstack/python-tripleoclient/commit/18a30e62eacaff46aaae3155ae7f642d636c5244
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 18a30e62eacaff46aaae3155ae7f642d636c5244
Author: Alex Schultz <email address hidden>
Date: Thu Sep 30 08:46:04 2021 -0600

    Use real tmpdir for ansible runner tests

    Additionally mock os.chmod in case the file does not exist.

    Change-Id: I404391c0c755681831c33ec7bc752b5d7878ed85
    Closes-Bug: #1945660
    (cherry picked from commit d5457bfb4ea02e92160f4356b515303c1a861f9c)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/python-tripleoclient/+/813102

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 17.1.0

This issue was fixed in the openstack/python-tripleoclient 17.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/python-tripleoclient/+/813102
Committed: https://opendev.org/openstack/python-tripleoclient/commit/b2c40c3e9e26ec6bb26cca8713e8368caf07b424
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit b2c40c3e9e26ec6bb26cca8713e8368caf07b424
Author: Alex Schultz <email address hidden>
Date: Thu Sep 30 08:46:04 2021 -0600

    Use real tmpdir for ansible runner tests

    Additionally mock os.chmod in case the file does not exist.

    Change-Id: I404391c0c755681831c33ec7bc752b5d7878ed85
    Closes-Bug: #1945660
    (cherry picked from commit d5457bfb4ea02e92160f4356b515303c1a861f9c)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 14.3.0

This issue was fixed in the openstack/python-tripleoclient 14.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 16.5.0

This issue was fixed in the openstack/python-tripleoclient 16.5.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.