neutron.tests.unit.common.test_utils.TimerTestCase.test__enter_with_timeout fails once in a while

Bug #1891517 reported by Flavio Fernandes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Flavio Fernandes

Bug Description

While running job openstack-tox-lower-constraints

https://zuul.opendev.org/t/openstack/job/openstack-tox-lower-constraints

I see intermittent failures that look lie this:

neutron.tests.unit.common.test_utils.TimerTestCase.test__enter_with_timeout
---------------------------------------------------------------------------

Captured traceback:

~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 182, in func'
    b' return f(self, *args, **kwargs)'
    b' File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/common/test_utils.py", line 551, in test__enter_with_timeout'
    b' self.assertEqual(1, round(timer.total_seconds()))'
    b' File "/home/zuul/src/opendev.org/openstack/neutron/.tox/lower-constraints/lib/python3.6/site-packages/testtools/testcase.py", line 411, in assertEqual'
    b' self.assertThat(observed, matcher, message)'
    b' File "/home/zuul/src/opendev.org/openstack/neutron/.tox/lower-constraints/lib/python3.6/site-packages/testtools/testcase.py", line 498, in assertThat'
    b' raise mismatch_error'
    b'testtools.matchers._impl.MismatchError: 1 != 2'
    b''

The code needs to do better in the rounding of the second. ;)

Reference run failure:

https://zuul.opendev.org/t/openstack/build/f031ac5c396a4610853fba5178e9fd1b

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/746154

Changed in neutron:
assignee: nobody → Flavio Fernandes (ffernand)
status: New → In Progress
Changed in neutron:
status: In Progress → Confirmed
importance: Undecided → High
tags: added: gate-failure
Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/746154
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=6a9fce39d6cf0051c6ea0f3bf5d57b9a7a03c3b8
Submitter: Zuul
Branch: master

commit 6a9fce39d6cf0051c6ea0f3bf5d57b9a7a03c3b8
Author: Flavio Fernandes <email address hidden>
Date: Thu Aug 13 10:56:23 2020 -0400

    "round" may bump 1 second to 2 if sleep takes more than 1.49 sec

    Use less than 2 as a way to account for test on slower systems.
    This is a follow up to: https://review.opendev.org/#/c/691883/

    Trivial-Fix

    Change-Id: Ia313b9c4028f0242cb0da8764b9921c5c30c465a
    Fixes-Bug: #1891517

Changed in neutron:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/757569

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/757572

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/757569
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=010d8f74a92f471d9c45bc3d4451b4be0985c9bf
Submitter: Zuul
Branch: stable/ussuri

commit 010d8f74a92f471d9c45bc3d4451b4be0985c9bf
Author: Flavio Fernandes <email address hidden>
Date: Thu Aug 13 10:56:23 2020 -0400

    "round" may bump 1 second to 2 if sleep takes more than 1.49 sec

    Use less than 2 as a way to account for test on slower systems.
    This is a follow up to: https://review.opendev.org/#/c/691883/

    Trivial-Fix

    Change-Id: Ia313b9c4028f0242cb0da8764b9921c5c30c465a
    Fixes-Bug: #1891517
    (cherry picked from commit 6a9fce39d6cf0051c6ea0f3bf5d57b9a7a03c3b8)

tags: added: in-stable-ussuri
tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/757572
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=35eddd53f9469cf8b1a220d5bc3e9d9776bc4094
Submitter: Zuul
Branch: stable/train

commit 35eddd53f9469cf8b1a220d5bc3e9d9776bc4094
Author: Flavio Fernandes <email address hidden>
Date: Thu Aug 13 10:56:23 2020 -0400

    "round" may bump 1 second to 2 if sleep takes more than 1.49 sec

    Use less than 2 as a way to account for test on slower systems.
    This is a follow up to: https://review.opendev.org/#/c/691883/

    Trivial-Fix

    Change-Id: Ia313b9c4028f0242cb0da8764b9921c5c30c465a
    Fixes-Bug: #1891517
    (cherry picked from commit 6a9fce39d6cf0051c6ea0f3bf5d57b9a7a03c3b8)

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.