Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 502
    • Issues 502
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • KeaKea
  • Issues
  • #355
Closed
Open
Created Dec 14, 2018 by Tomek Mrugalski@tomek🛰Owner

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.
Edited Dec 14, 2018 by Tomek Mrugalski
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking