A funny story about horology regression test failures...
От | Brian E. Pangburn |
---|---|
Тема | A funny story about horology regression test failures... |
Дата | |
Msg-id | b6tai4$1084$1@news.hub.org обсуждение исходный текст |
Список | pgsql-hackers |
So, there I was upgrading my DB server from 7.3.1. to 7.3.2 and like a good little admin, I recompiled my sources and ran the regression tests. Lo and behold for the first time in several years of running regression tests, I encountered a horology error. I've had two successful 7.3.2 regression tests on other servers and was a bit puzzled. Well, I decided to search around the hackers list and discovered a thread discussing a glitch in src/bin/psql/common.c. "I can patch that!" I thought so off into my vi editor I went. I made the changes, recompiled, and, well, there was the same error. Damn. "Hmmm, guess I'll have a look at regression.diffs now," I said (of course I probably should have started there). Here's what I got: ====================================================================== *** ./expected/horology.out Wed Sep 18 16:35:25 2002 --- ./results/horology.out Mon Apr 7 20:54:47 2003 *************** *** 531,537 **** SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True"; True ------ ! t (1 row) SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True"; --- 531,537 ---- SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True"; True ------ ! f (1 row) SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True"; *************** *** 543,549 **** SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True"; True ------ ! t (1 row) SELECT (timestamp with time zone 'tomorrow' > 'now') as "True"; --- 543,549 ---- SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True"; True ------ ! f (1 row) SELECT (timestamp with time zone 'tomorrow' > 'now') as "True"; ====================================================================== Wait a second, this test is verifying elapsed time intervals over the past few days! Unfortunately, the elapsed time is NOT one day when you crossover into DAYLIGHT SAVINGS TIME! Bumped my system clock by a few days and the tests passed with flying colors. Moral of the story... Don't run regression tests a few days before/after a time change!
В списке pgsql-hackers по дате отправления: