mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-30 02:37:19 +02:00
Reduce test runtime of src/test/modules/snapshot_too_old.
The sto_using_cursor and sto_using_select tests were coded to exercise every permutation of their test steps, but AFAICS there is no value in exercising more than one. This matters because each permutation costs about six seconds, thanks to the "pg_sleep(6)". Perhaps we could reduce that, but the useless permutations seem worth getting rid of in any case. (Note that sto_using_hash_index got it right already.) While here, clean up some other sloppiness such as an unused table. This doesn't make too much difference in interactive testing, since the wasted time is typically masked by parallelization with other tests. However, the buildfarm runs this as a serial step, which means we can expect to shave ~40 seconds from every buildfarm run. That makes it worth back-patching. Discussion: https://postgr.es/m/2515192.1659454702@sss.pgh.pa.us
This commit is contained in:
parent
6b67db10c3
commit
b2694aebe3
@ -1,27 +1,5 @@
|
|||||||
Parsed test spec with 2 sessions
|
Parsed test spec with 2 sessions
|
||||||
|
|
||||||
starting permutation: s1decl s1f1 s1sleep s1f2 s2u
|
|
||||||
step s1decl: DECLARE cursor1 CURSOR FOR SELECT c FROM sto1;
|
|
||||||
step s1f1: FETCH FIRST FROM cursor1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
|
|
||||||
setting|pg_sleep
|
|
||||||
-------+--------
|
|
||||||
0|
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1f2: FETCH FIRST FROM cursor1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
|
||||||
|
|
||||||
starting permutation: s1decl s1f1 s1sleep s2u s1f2
|
starting permutation: s1decl s1f1 s1sleep s2u s1f2
|
||||||
step s1decl: DECLARE cursor1 CURSOR FOR SELECT c FROM sto1;
|
step s1decl: DECLARE cursor1 CURSOR FOR SELECT c FROM sto1;
|
||||||
step s1f1: FETCH FIRST FROM cursor1;
|
step s1f1: FETCH FIRST FROM cursor1;
|
||||||
@ -39,57 +17,3 @@ setting|pg_sleep
|
|||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
||||||
step s1f2: FETCH FIRST FROM cursor1;
|
step s1f2: FETCH FIRST FROM cursor1;
|
||||||
ERROR: snapshot too old
|
ERROR: snapshot too old
|
||||||
|
|
||||||
starting permutation: s1decl s1f1 s2u s1sleep s1f2
|
|
||||||
step s1decl: DECLARE cursor1 CURSOR FOR SELECT c FROM sto1;
|
|
||||||
step s1f1: FETCH FIRST FROM cursor1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
|
||||||
step s1sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
|
|
||||||
setting|pg_sleep
|
|
||||||
-------+--------
|
|
||||||
0|
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1f2: FETCH FIRST FROM cursor1;
|
|
||||||
ERROR: snapshot too old
|
|
||||||
|
|
||||||
starting permutation: s1decl s2u s1f1 s1sleep s1f2
|
|
||||||
step s1decl: DECLARE cursor1 CURSOR FOR SELECT c FROM sto1;
|
|
||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
|
||||||
step s1f1: FETCH FIRST FROM cursor1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
|
|
||||||
setting|pg_sleep
|
|
||||||
-------+--------
|
|
||||||
0|
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1f2: FETCH FIRST FROM cursor1;
|
|
||||||
ERROR: snapshot too old
|
|
||||||
|
|
||||||
starting permutation: s2u s1decl s1f1 s1sleep s1f2
|
|
||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
|
||||||
step s1decl: DECLARE cursor1 CURSOR FOR SELECT c FROM sto1;
|
|
||||||
step s1f1: FETCH FIRST FROM cursor1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
2
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
|
|
||||||
setting|pg_sleep
|
|
||||||
-------+--------
|
|
||||||
0|
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1f2: FETCH FIRST FROM cursor1;
|
|
||||||
ERROR: snapshot too old
|
|
||||||
|
@ -1,26 +1,5 @@
|
|||||||
Parsed test spec with 2 sessions
|
Parsed test spec with 2 sessions
|
||||||
|
|
||||||
starting permutation: s1f1 s1sleep s1f2 s2u
|
|
||||||
step s1f1: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
|
|
||||||
setting|pg_sleep
|
|
||||||
-------+--------
|
|
||||||
0|
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1f2: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
|
||||||
|
|
||||||
starting permutation: s1f1 s1sleep s2u s1f2
|
starting permutation: s1f1 s1sleep s2u s1f2
|
||||||
step s1f1: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
step s1f1: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
||||||
c
|
c
|
||||||
@ -37,37 +16,3 @@ setting|pg_sleep
|
|||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
||||||
step s1f2: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
step s1f2: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
||||||
ERROR: snapshot too old
|
ERROR: snapshot too old
|
||||||
|
|
||||||
starting permutation: s1f1 s2u s1sleep s1f2
|
|
||||||
step s1f1: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
|
||||||
step s1sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
|
|
||||||
setting|pg_sleep
|
|
||||||
-------+--------
|
|
||||||
0|
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1f2: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
|
||||||
ERROR: snapshot too old
|
|
||||||
|
|
||||||
starting permutation: s2u s1f1 s1sleep s1f2
|
|
||||||
step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1;
|
|
||||||
step s1f1: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
|
||||||
c
|
|
||||||
-
|
|
||||||
2
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
|
|
||||||
setting|pg_sleep
|
|
||||||
-------+--------
|
|
||||||
0|
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1f2: SELECT c FROM sto1 ORDER BY c LIMIT 1;
|
|
||||||
ERROR: snapshot too old
|
|
||||||
|
@ -6,14 +6,13 @@
|
|||||||
# granularity is in minutes.
|
# granularity is in minutes.
|
||||||
#
|
#
|
||||||
# Since results depend on the value of old_snapshot_threshold, sneak that into
|
# Since results depend on the value of old_snapshot_threshold, sneak that into
|
||||||
# the line generated by the sleep, so that a surprising values isn't so hard
|
# the line generated by the sleep, so that a surprising value isn't so hard
|
||||||
# to identify.
|
# to identify.
|
||||||
|
|
||||||
setup
|
setup
|
||||||
{
|
{
|
||||||
CREATE TABLE sto1 (c int NOT NULL);
|
CREATE TABLE sto1 (c int NOT NULL);
|
||||||
INSERT INTO sto1 SELECT generate_series(1, 1000);
|
INSERT INTO sto1 SELECT generate_series(1, 1000);
|
||||||
CREATE TABLE sto2 (c int NOT NULL);
|
|
||||||
}
|
}
|
||||||
setup
|
setup
|
||||||
{
|
{
|
||||||
@ -22,7 +21,7 @@ setup
|
|||||||
|
|
||||||
teardown
|
teardown
|
||||||
{
|
{
|
||||||
DROP TABLE sto1, sto2;
|
DROP TABLE sto1;
|
||||||
}
|
}
|
||||||
|
|
||||||
session "s1"
|
session "s1"
|
||||||
@ -35,3 +34,5 @@ teardown { COMMIT; }
|
|||||||
|
|
||||||
session "s2"
|
session "s2"
|
||||||
step "s2u" { UPDATE sto1 SET c = 1001 WHERE c = 1; }
|
step "s2u" { UPDATE sto1 SET c = 1001 WHERE c = 1; }
|
||||||
|
|
||||||
|
permutation "s1decl" "s1f1" "s1sleep" "s2u" "s1f2"
|
||||||
|
@ -6,14 +6,13 @@
|
|||||||
# granularity is in minutes.
|
# granularity is in minutes.
|
||||||
#
|
#
|
||||||
# Since results depend on the value of old_snapshot_threshold, sneak that into
|
# Since results depend on the value of old_snapshot_threshold, sneak that into
|
||||||
# the line generated by the sleep, so that a surprising values isn't so hard
|
# the line generated by the sleep, so that a surprising value isn't so hard
|
||||||
# to identify.
|
# to identify.
|
||||||
|
|
||||||
setup
|
setup
|
||||||
{
|
{
|
||||||
CREATE TABLE sto1 (c int NOT NULL);
|
CREATE TABLE sto1 (c int NOT NULL);
|
||||||
INSERT INTO sto1 SELECT generate_series(1, 1000);
|
INSERT INTO sto1 SELECT generate_series(1, 1000);
|
||||||
CREATE TABLE sto2 (c int NOT NULL);
|
|
||||||
}
|
}
|
||||||
setup
|
setup
|
||||||
{
|
{
|
||||||
@ -22,7 +21,7 @@ setup
|
|||||||
|
|
||||||
teardown
|
teardown
|
||||||
{
|
{
|
||||||
DROP TABLE sto1, sto2;
|
DROP TABLE sto1;
|
||||||
}
|
}
|
||||||
|
|
||||||
session "s1"
|
session "s1"
|
||||||
@ -34,3 +33,5 @@ teardown { COMMIT; }
|
|||||||
|
|
||||||
session "s2"
|
session "s2"
|
||||||
step "s2u" { UPDATE sto1 SET c = 1001 WHERE c = 1; }
|
step "s2u" { UPDATE sto1 SET c = 1001 WHERE c = 1; }
|
||||||
|
|
||||||
|
permutation "s1f1" "s1sleep" "s2u" "s1f2"
|
||||||
|
Loading…
Reference in New Issue
Block a user