pgsql: Adjust timestamp regression tests to prevent two low-probability

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Adjust timestamp regression tests to prevent two low-probability
Date: 2008-05-25 21:51:17
Message-ID: 20080525215117.D4FF9754C54@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
pgsql/src/test/regress/expected:
timestamp.out (r1.31.2.1 -> r1.31.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/timestamp.out?r1=1.31.2.1&r2=1.31.2.2)
timestamptz.out (r1.21.2.2 -> r1.21.2.3)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/timestamptz.out?r1=1.21.2.2&r2=1.21.2.3)
pgsql/src/test/regress/sql:
timestamp.sql (r1.17 -> r1.17.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/timestamp.sql?r1=1.17&r2=1.17.2.1)
timestamptz.sql (r1.10.2.1 -> r1.10.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/timestamptz.sql?r1=1.10.2.1&r2=1.10.2.2)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2008-05-25 21:51:23 pgsql: Adjust timestamp regression tests to prevent two low-probability
Previous Message Tom Lane 2008-05-25 21:51:11 pgsql: Adjust timestamp regression tests to prevent two low-probability