Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a6d3dea

Browse files
committed
Disable force_parallel_mode in libpq_pipeline
Some buildfarm animals with force_parallel_mode=regress were failing this test because the error is reported in a parallel worker quicker than the rows that succeed. Take the opportunity to move the SET of lc_messages out of the traced section, because it's not very interesting. Diagnosed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/3304521.1617221724@sss.pgh.pa.us
1 parent 9e20406 commit a6d3dea

File tree

8 files changed

+8
-25
lines changed

8 files changed

+8
-25
lines changed

src/test/modules/libpq_pipeline/libpq_pipeline.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ test_pipeline_abort(PGconn *conn)
438438
if (PQresultStatus(res) != PGRES_PIPELINE_SYNC)
439439
pg_fatal("Unexpected result code %s from pipeline sync",
440440
PQresStatus(PQresultStatus(res)));
441+
fprintf(stderr, "ok\n");
441442

442443
/* Test single-row mode with an error partways */
443444
if (PQsendQuery(conn, "SELECT 1.0/g FROM generate_series(3, -1, -1) g") != 1)
@@ -1308,6 +1309,13 @@ main(int argc, char **argv)
13081309
exit_nicely(conn);
13091310
}
13101311

1312+
res = PQexec(conn, "SET lc_messages TO \"C\"");
1313+
if (PQresultStatus(res) != PGRES_COMMAND_OK)
1314+
pg_fatal("failed to set lc_messages: %s", PQerrorMessage(conn));
1315+
res = PQexec(conn, "SET force_parallel_mode = off");
1316+
if (PQresultStatus(res) != PGRES_COMMAND_OK)
1317+
pg_fatal("failed to set force_parallel_mode: %s", PQerrorMessage(conn));
1318+
13111319
/* Set the trace file, if requested */
13121320
if (tracefile != NULL)
13131321
{
@@ -1320,10 +1328,6 @@ main(int argc, char **argv)
13201328
PQTRACE_SUPPRESS_TIMESTAMPS | PQTRACE_REGRESS_MODE);
13211329
}
13221330

1323-
res = PQexec(conn, "SET lc_messages TO \"C\"");
1324-
if (PQresultStatus(res) != PGRES_COMMAND_OK)
1325-
pg_fatal("failed to set lc_messages: %s", PQerrorMessage(conn));
1326-
13271331
if (strcmp(testname, "disallowed_in_pipeline") == 0)
13281332
test_disallowed_in_pipeline(conn);
13291333
else if (strcmp(testname, "multi_pipelines") == 0)

src/test/modules/libpq_pipeline/traces/disallowed_in_pipeline.trace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
F 27 Query "SET lc_messages TO "C""
2-
B 8 CommandComplete "SET"
3-
B 5 ReadyForQuery I
41
F 13 Query "SELECT 1"
52
B 33 RowDescription 1 "?column?" NNNN 0 NNNN 4 -1 0
63
B 11 DataRow 1 1 '1'

src/test/modules/libpq_pipeline/traces/multi_pipelines.trace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
F 27 Query "SET lc_messages TO "C""
2-
B 8 CommandComplete "SET"
3-
B 5 ReadyForQuery I
41
F 21 Parse "" "SELECT $1" 1 NNNN
52
F 19 Bind "" "" 0 1 1 '1' 1 0
63
F 6 Describe P ""

src/test/modules/libpq_pipeline/traces/pipeline_abort.trace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
F 27 Query "SET lc_messages TO "C""
2-
B 8 CommandComplete "SET"
3-
B 5 ReadyForQuery I
41
F 42 Query "DROP TABLE IF EXISTS pq_pipeline_demo"
52
B 123 NoticeResponse S "NOTICE" V "NOTICE" C "00000" M "table "pq_pipeline_demo" does not exist, skipping" F "SSSS" L "SSSS" R "SSSS" \x00
63
B 15 CommandComplete "DROP TABLE"

src/test/modules/libpq_pipeline/traces/prepared.trace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
F 27 Query "SET lc_messages TO "C""
2-
B 8 CommandComplete "SET"
3-
B 5 ReadyForQuery I
41
F 68 Parse "select_one" "SELECT $1, '42', $1::numeric, interval '1 sec'" 1 NNNN
52
F 16 Describe S "select_one"
63
F 4 Sync

src/test/modules/libpq_pipeline/traces/simple_pipeline.trace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
F 27 Query "SET lc_messages TO "C""
2-
B 8 CommandComplete "SET"
3-
B 5 ReadyForQuery I
41
F 21 Parse "" "SELECT $1" 1 NNNN
52
F 19 Bind "" "" 0 1 1 '1' 1 0
63
F 6 Describe P ""

src/test/modules/libpq_pipeline/traces/singlerow.trace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
F 27 Query "SET lc_messages TO "C""
2-
B 8 CommandComplete "SET"
3-
B 5 ReadyForQuery I
41
F 38 Parse "" "SELECT generate_series(42, $1)" 0
52
F 20 Bind "" "" 0 1 2 '44' 1 0
63
F 6 Describe P ""

src/test/modules/libpq_pipeline/traces/transaction.trace

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
F 27 Query "SET lc_messages TO "C""
2-
B 8 CommandComplete "SET"
3-
B 5 ReadyForQuery I
41
F 79 Query "DROP TABLE IF EXISTS pq_pipeline_tst;CREATE TABLE pq_pipeline_tst (id int)"
52
B 122 NoticeResponse S "NOTICE" V "NOTICE" C "00000" M "table "pq_pipeline_tst" does not exist, skipping" F "SSSS" L "SSSS" R "SSSS" \x00
63
B 15 CommandComplete "DROP TABLE"

0 commit comments

Comments
 (0)