Fix timestamps in tests as Travis builds run on GMT time

When launched manually, tests should be launched with the environment
variable TZ=GMT. Maybe this could be useful to add that explicitly
somewhere in the README or in the Makefile.
This commit is contained in:
Jean-Baptiste Barth 2015-11-03 09:09:00 +01:00
parent e9732140e5
commit f4feec4727
5 changed files with 10 additions and 10 deletions

View File

@ -75,12 +75,12 @@ def test_activity_task_reset_heartbeat_clock():
workflow_execution=wfe,
)
task.last_heartbeat_timestamp.should.equal(1420110000.0)
task.last_heartbeat_timestamp.should.equal(1420113600.0)
with freeze_time("2015-01-01 13:00:00"):
task.reset_heartbeat_clock()
task.last_heartbeat_timestamp.should.equal(1420113600.0)
task.last_heartbeat_timestamp.should.equal(1420117200.0)
def test_activity_task_has_timedout():
wfe = make_workflow_execution()

View File

@ -9,7 +9,7 @@ def test_history_event_creation():
he = HistoryEvent(123, "DecisionTaskStarted", scheduled_event_id=2)
he.event_id.should.equal(123)
he.event_type.should.equal("DecisionTaskStarted")
he.event_timestamp.should.equal(1420110000.0)
he.event_timestamp.should.equal(1420113600.0)
@freeze_time("2015-01-01 12:00:00")
def test_history_event_to_dict_representation():
@ -17,7 +17,7 @@ def test_history_event_to_dict_representation():
he.to_dict().should.equal({
"eventId": 123,
"eventType": "DecisionTaskStarted",
"eventTimestamp": 1420110000.0,
"eventTimestamp": 1420113600.0,
"decisionTaskStartedEventAttributes": {
"scheduledEventId": 2
}

View File

@ -165,7 +165,7 @@ def test_workflow_execution_start():
wfe.events().should.equal([])
wfe.start()
wfe.start_timestamp.should.equal(1420110000.0)
wfe.start_timestamp.should.equal(1420113600.0)
wfe.events().should.have.length_of(2)
wfe.events()[0].event_type.should.equal("WorkflowExecutionStarted")
wfe.events()[1].event_type.should.equal("DecisionTaskScheduled")
@ -177,7 +177,7 @@ def test_workflow_execution_complete():
wfe.execution_status.should.equal("CLOSED")
wfe.close_status.should.equal("COMPLETED")
wfe.close_timestamp.should.equal(1420196400.0)
wfe.close_timestamp.should.equal(1420200000.0)
wfe.events()[-1].event_type.should.equal("WorkflowExecutionCompleted")
wfe.events()[-1].decision_task_completed_event_id.should.equal(123)
wfe.events()[-1].result.should.equal("foo")
@ -189,7 +189,7 @@ def test_workflow_execution_fail():
wfe.execution_status.should.equal("CLOSED")
wfe.close_status.should.equal("FAILED")
wfe.close_timestamp.should.equal(1420196400.0)
wfe.close_timestamp.should.equal(1420200000.0)
wfe.events()[-1].event_type.should.equal("WorkflowExecutionFailed")
wfe.events()[-1].decision_task_completed_event_id.should.equal(123)
wfe.events()[-1].details.should.equal("some details")
@ -202,7 +202,7 @@ def test_workflow_execution_schedule_activity_task():
wfe.schedule_activity_task(123, VALID_ACTIVITY_TASK_ATTRIBUTES)
wfe.latest_activity_task_timestamp.should.equal(1420110000.0)
wfe.latest_activity_task_timestamp.should.equal(1420113600.0)
wfe.open_counts["openActivityTasks"].should.equal(1)
last_event = wfe.events()[-1]

View File

@ -313,4 +313,4 @@ def test_respond_decision_task_completed_with_schedule_activity_task():
})
resp = conn.describe_workflow_execution("test-domain", conn.run_id, "uid-abcd1234")
resp["latestActivityTaskTimestamp"].should.equal(1420110000.0)
resp["latestActivityTaskTimestamp"].should.equal(1420113600.0)

View File

@ -18,4 +18,4 @@ def test_decapitalize():
@freeze_time("2015-01-01 12:00:00")
def test_now_timestamp():
now_timestamp().should.equal(1420110000.0)
now_timestamp().should.equal(1420113600.0)