Postgres unit-tests fail in weird way if postgres timezone is set incorrectly
I live in Poland (CET, GMT+1), but I was visiting London (GMT) and installed Postgres. It had this in postgresql.conf:
datestyle = 'iso, mdy'
timezone = 'GB'
However, my system timezone (as set in mac os control panel) was CET.
This caused weird error in unit-tests:
[ RUN ] PgSqlBasicsTest.timeStampTest
NOTICE: table "basics" does not exist, skipping
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 1544791527
To be equal to: times[row]
Which is: 1544787927
row: 0
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 2147487247
To be equal to: times[row]
Which is: 2147483647
row: 1
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 4294970895
To be equal to: times[row]
Which is: 4294967295
row: 2
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 1544877927
To be equal to: times[row]
Which is: 1544874327
row: 3
[ FAILED ] PgSqlBasicsTest.timeStampTest (40 ms)
```.
Yes, this was a weird configuration, but Kea should have done both conversions using the same timezone.
At the very least we should print a warning about checking timezone configuration if the values are off by multiplicity of 3600 seconds.