Skip to content

Commit 47169c2

Browse files
committed
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
1 parent 1e87198 commit 47169c2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/test/regress/expected/timestamp.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time z
7474
(1 row)
7575

7676
COMMIT;
77-
DELETE FROM TIMESTAMP_TBL;
77+
TRUNCATE TIMESTAMP_TBL;
7878
-- Special values
7979
INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');
8080
INSERT INTO TIMESTAMP_TBL VALUES ('infinity');

src/test/regress/sql/timestamp.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SELECT pg_sleep(0.1);
4444
SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now';
4545
COMMIT;
4646

47-
DELETE FROM TIMESTAMP_TBL;
47+
TRUNCATE TIMESTAMP_TBL;
4848

4949
-- Special values
5050
INSERT INTO TIMESTAMP_TBL VALUES ('-infinity');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy