]> granicus.if.org Git - postgresql/commit
Adjust timestamp regression tests to prevent two low-probability failure
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 May 2008 21:51:17 +0000 (21:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 May 2008 21:51:17 +0000 (21:51 +0000)
commitc4801d94dbc35726e2517f6e58e15ce26559d5fe
tree183dedc4a7982a30ccd428a62cd6c750cba16d20
parentc5db07d34d4ae92445d56a38c1ea6aee8b4b9c5b
Adjust timestamp regression tests to prevent two low-probability failure
cases.  Recent buildfarm experience shows that it is sometimes possible
to execute several SQL commands in less time than the granularity of
Windows' not-very-high-resolution gettimeofday(), leading to a failure
because the tests expect the value of now() to change and it doesn't.
Also, it was recognized some time ago that the same area of the tests
could fail if local midnight passes between the insertion and the checking
of the values for 'yesterday', 'tomorrow', etc.  Clean all this up per
ideas from myself and Greg Stark.

There remains a window for failure if the transaction block is entered
exactly at local midnight (so that 'now' and 'today' have the same value),
but that seems low-probability enough to live with.

Since the point of this change is mostly to eliminate buildfarm noise,
back-patch to all versions we are still actively testing.
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamptz.out
src/test/regress/sql/timestamp.sql
src/test/regress/sql/timestamptz.sql