Project

Profile

Help

Refactor #743

closed

unit.server.managers.schedule.test_utils.TestUpdate.test_update should not depend on wall clock timing

Added by rbarlow about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

There is a unit test that fails periodically for me:

======================================================================
FAIL: test_update (unit.server.managers.schedule.test_utils.TestUpdate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/mock.py", line 1224, in patched
    return func(*args, **keywargs)
  File "/home/rbarlow/devel/pulp/server/test/unit/server/managers/schedule/test_utils.py", line 251, in test_update
    self.assertTrue(time.time() - last_updated < .1)
AssertionError

----------------------------------------------------------------------
Ran 1912 tests in 71.563s

FAILED (failures=1)

I've had some trouble getting this particular test to pass over a few runs. My dev box is a VM on a system with several others running right now, and this seems to lend itself to timing problems with this test.

We should refactor this test to avoid depending on wall clock time, perhaps by using freezegun or mock.


Related issues

Is duplicate of Pulp - Issue #729: Pulp tests should not rely on wall clock timeCLOSED - WONTFIXActions

Also available in: Atom PDF