pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: seregaizsbera (@seregaizsbera) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #3532: Datetime-related tests improved
Date: Fri, 21 Feb 2025 10:15:48 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

(on pgjdbc/src/test/java/org/postgresql/jdbc/TimeZoneTest.java)

> As you add assertions, please consider messages that would clarify the reason the assertion is there.
> 
> The current assertion would fail as `testConnection[zoneId=Europe/Paris] expected: true, got: false Client and server time are close enough`. I'm not sure it provides enough information to convey why the client and server times must match.

If your test failed at Europe/Paris, you most likely caught a bug. This may happen if the server or client clock is wrong, for instance NTP failure. The other reason may be a difference in timezone definitions. The same zone Europe/Paris has different params on client and on server. My test executes successfully at Europe/Paris.

In ideal conditions server and client time must be equal. But we can't receive equal values, since measurement of time doesn't occur simultaneously. That's why it is compared with deviation. The deviation of 10 seconds is enough for this comparison. 

view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #3532: Datetime-related tests improved
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox