← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1891517] Re: neutron.tests.unit.common.test_utils.TimerTestCase.test__enter_with_timeout fails once in a while

 

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 <flaviof@xxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1891517

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

Status in neutron:
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1891517/+subscriptions


References