pulp/pulp — pull request #817 by mhrivnak (2014-02-27 14:10:28+00:00)
Title: improving a test to tolerate clock rollover to the next second

The test compares two representations of a scheduled call, and each calculates
the "next_run" attribute on-the-fly. Very rarely the clock will roll over to
the next full second between those two calculations, causing them to not be
equal. This change compares them within a tolerance of 1 second instead of
requiring equality.

Here was the failure seen. Note the milliseconds on ``last_updated`` approaching the next second, suggesting we're about to hit the rollover:
```
AssertionError: {'next_run': '2014-02-26T14:08:20Z', 'remaining_runs': None, 'last_updated': 139 [truncated]... != {'next_run': '2014-02-26T14:08:21Z', 'remaining_runs': None, 'last_updated': 139 [truncated]...
{'_id': '530df554fd94c61b5ca57d65',
'args': [],
'consecutive_failures': 0,
'enabled': True,
'failure_threshold': None,
'first_run': '2014-02-26T14:08:20Z',
'kwargs': {},
'last_run_at': None,
'last_updated': 1393423700.997587,
- 'next_run': '2014-02-26T14:08:20Z',
? ^

+ 'next_run': '2014-02-26T14:08:21Z',
? ^

'remaining_runs': None,
'resource': None,
'schedule': 'PT1M',
'task': 'pulp.tasks.frequent',
'total_run_count': 0}
```