Skip to content

Commit

Permalink
Merge pull request #1456 from gst/test_services_fix_non_deterministic…
Browse files Browse the repository at this point in the history
…_assert

Test: services: fix non-deterministic assert.
  • Loading branch information
Seb-Solon committed Jan 14, 2015
2 parents fa90a46 + 63ce245 commit a04a526
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,12 @@ def test_service_last_hard_state(self):
self.assertEqual('OK', svc.last_hard_state)

# now go hard!
time.sleep(2)
now = int(time.time())
self.assertLess(svc.last_hard_state_change, now)
self.scheduler_loop(1, [[svc, 2, 'CRITICAL | bibi=99%']])
print "FUCK", svc.state_type
self.assertEqual(now, svc.last_hard_state_change)
self.assertGreaterEqual(svc.last_hard_state_change, now)
self.assertEqual('CRITICAL', svc.last_hard_state)
print "Last hard state id", svc.last_hard_state_id
self.assertEqual(2, svc.last_hard_state_id)
Expand Down

0 comments on commit a04a526

Please sign in to comment.