diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-04-15 16:19:51 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-04-15 16:20:01 -0400 |
commit | 47169c25500a70a7d04076860717f2f4f0ea83a7 (patch) | |
tree | e16d75295edcaf7c2fd5c10803dcfffb5e17898f | |
parent | 1e871981823a68ec9e0174b652e8d27e05ce08bb (diff) |
Avoid possible regression test instability in timestamp.sql.
Concurrent autovacuum could result in a change in the order of the
live rows in timestamp_tbl. While this would not happen with the
default autovacuum parameters, it's fairly easy to hit if
autovacuum_vacuum_threshold is made small enough to allow autovac
to decide to process this table. That's a stumbling block for trying
to exercise autovacuum aggressively using the core regression tests.
To fix, replace an unqualified DELETE with a TRUNCATE. There's a
similar DELETE just above (and no order-sensitive queries between),
so this doesn't lose any test coverage and might indeed be argued
to improve it.
Discussion: https://postgr.es/m/17428.1555348950@sss.pgh.pa.us
-rw-r--r-- | src/test/regress/expected/timestamp.out | 2 | ||||
-rw-r--r-- | src/test/regress/sql/timestamp.sql | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/regress/expected/timestamp.out b/src/test/regress/expected/timestamp.out index 4a2fabddd9f..b2b171f5601 100644 --- a/src/test/regress/expected/timestamp.out +++ b/src/test/regress/expected/timestamp.out @@ -74,7 +74,7 @@ SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time z (1 row) COMMIT; -DELETE FROM TIMESTAMP_TBL; +TRUNCATE TIMESTAMP_TBL; -- Special values INSERT INTO TIMESTAMP_TBL VALUES ('-infinity'); INSERT INTO TIMESTAMP_TBL VALUES ('infinity'); diff --git a/src/test/regress/sql/timestamp.sql b/src/test/regress/sql/timestamp.sql index b7957cbb9aa..150eb54c870 100644 --- a/src/test/regress/sql/timestamp.sql +++ b/src/test/regress/sql/timestamp.sql @@ -44,7 +44,7 @@ SELECT pg_sleep(0.1); SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now'; COMMIT; -DELETE FROM TIMESTAMP_TBL; +TRUNCATE TIMESTAMP_TBL; -- Special values INSERT INTO TIMESTAMP_TBL VALUES ('-infinity'); |