Message-ID: From: "seregaizsbera (@seregaizsbera)" To: "pgjdbc/pgjdbc" Date: Fri, 21 Feb 2025 10:15:48 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3532: Datetime-related tests improved In-Reply-To: References: List-Id: X-GitHub-Author-Login: seregaizsbera X-GitHub-Comment-Id: 1965227021 X-GitHub-Comment-Type: review_comment X-GitHub-Commit: 38450b85eaab5592158abe485f634468f6943dd7 X-GitHub-Issue: 3532 X-GitHub-Path: pgjdbc/src/test/java/org/postgresql/jdbc/TimeZoneTest.java X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: review_comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3532#discussion_r1965227021 Content-Type: text/plain; charset=utf-8 (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.