From dc5e30296d78b3171188acaef8bca1ae4e7b4596 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 31 Mar 2016 14:38:23 +0100 Subject: Fix test issue running on PostgreSQL>=9.2 on Mac. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test::PostgreSQL sets up a new database with initdb and empties the generated postgresql.conf; PostgreSQL 9.2+ sets its locale/timezone information at the initdb stage, not when it is run. It is possible therefore for the tests to be in one timezone but the test database to be in another (GMT) – causing a test failure when e.g. an update is created manually. Make sure the first comment is well before the others being tested, so there is no chance the order gets confused. --- t/app/controller/report_updates.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index f9f5189e5..7b4bf7854 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -760,7 +760,8 @@ subtest 'check meta correct for comments marked confirmed but not marked open' = user => $user, problem_id => $report->id, text => 'update text', - confirmed => DateTime->now( time_zone => 'local' ), + # Subtract a day to deal with any code/db timezone difference + confirmed => DateTime->now( time_zone => 'local' ) - DateTime::Duration->new( days => 1 ), problem_state => 'confirmed', anonymous => 0, mark_open => 0, -- cgit v1.2.3