Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug 800428, fix failing test test_buildIDSchedFunc, r=catlee

  • Loading branch information...
commit a537845191b804eac9c38f64dc47b28196bb0e1c 1 parent c6bbeba
Nick Thomas nthomas-mozilla authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 test/test_misc_scheduler_propfuncs.py
12 test/test_misc_scheduler_propfuncs.py
View
@@ -37,30 +37,32 @@ def tearDown(self):
def test_buildIDSchedFunc(self):
import time
with mock.patch.object(time, 'time') as time_method:
- time_method.return_value = 58
+ # need to make sure we are at least a day after the epoch to avoid
+ # timezone issues near our default of 19700101000000
+ time_method.return_value = 86458
self.dbc.runInteractionNow(lambda t: buildIDSchedFunc(self.s, t, None))
state = self.dbc.runInteractionNow(lambda t: self.s.get_state(t))
- self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(58)))
+ self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(86458)))
# Running this again at the same time should increment our buildid by 1
self.dbc.runInteractionNow(lambda t: buildIDSchedFunc(self.s, t, None))
state = self.dbc.runInteractionNow(lambda t: self.s.get_state(t))
- self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(59)))
+ self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(86459)))
# Running this again at the same time should increment our buildid by 1
# and cross the minute boundary properly
self.dbc.runInteractionNow(lambda t: buildIDSchedFunc(self.s, t, None))
state = self.dbc.runInteractionNow(lambda t: self.s.get_state(t))
self.assertEquals(state['last_buildid'][-3:], '100')
- self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(60)))
+ self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(86460)))
# If time happens to go backwards, our buildid shouldn't
time_method.return_value = 8
self.dbc.runInteractionNow(lambda t: buildIDSchedFunc(self.s, t, None))
state = self.dbc.runInteractionNow(lambda t: self.s.get_state(t))
self.assertEquals(state['last_buildid'][-3:], '101')
- self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(61)))
+ self.assertEquals(state['last_buildid'], time.strftime("%Y%m%d%H%M%S", time.localtime(86461)))
def test_buildUIDSchedFunc(self):
import uuid
Please sign in to comment.
Something went wrong with that request. Please try again.