Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita6285b1

Browse files
committed
tests: Fix incompatibility of test_aio with *_FORCE_RELEASE
The test added in93bc3d7 failed in a build with RELCACHE_FORCE_RELEASEand CATCACHE_FORCE_RELEASE defined. The test intentionally forgets to exitbatchmode - normally that would trigger an error at the end of thetransaction, which the test verifies. However, with RELCACHE_FORCE_RELEASEand CATCACHE_FORCE_RELEASE defined, we get other code (output function lookup)entering batchmode and erroring out because batchmode isn't allowed to beentered recursively.Fix that by changing the queries in question to not output any rows. That'snot exactly pretty, but seems to avoid the problem reliably.Eventually we might want to make RELCACHE_FORCE_RELEASE andCATCACHE_FORCE_RELEASE GUCs, so we can disable them where necessary - thisisn't the first test having difficulty with those debug options. But that'sfor later.Per buildfarm member prion.Discussion:https://postgr.es/m/uc62i6vi5gd4bi6wtjj5poadqxolgy55e7ihkmf3mthjegb6zl@zqo7xez7sc2r
1 parent43dca8a commita6285b1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎src/test/modules/test_aio/t/001_aio.pl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,18 @@ sub test_batchmode
325325

326326
my$psql =$node->background_psql('postgres',on_error_stop=> 0);
327327

328+
# In a build with RELCACHE_FORCE_RELEASE and CATCACHE_FORCE_RELEASE, just
329+
# using SELECT batch_start() causes spurious test failures, because the
330+
# lookup of the type information when printing the result tuple also
331+
# starts a batch. The easiest way around is to not print a result tuple.
332+
my$batch_start_sql =qq(SELECT WHERE batch_start() IS NULL);
333+
328334
# leak warning & recovery: implicit xact
329335
psql_like(
330336
$io_method,
331337
$psql,
332338
"batch_start() leak & cleanup in implicit xact",
333-
qq(SELECT batch_start()),
339+
$batch_start_sql,
334340
qr/^$/,
335341
qr/open AIO batch at end/,
336342
"$io_method: leaky batch_start() warns");
@@ -340,7 +346,7 @@ sub test_batchmode
340346
$io_method,
341347
$psql,
342348
"batch_start() leak & cleanup in explicit xact",
343-
qq(BEGIN;SELECT batch_start(); COMMIT;),
349+
qq(BEGIN;$batch_start_sql; COMMIT;),
344350
qr/^$/,
345351
qr/open AIO batch at end/,
346352
"$io_method: leaky batch_start() warns");
@@ -353,7 +359,7 @@ sub test_batchmode
353359
# it just means it's a bit harder to find buggy code.
354360
#psql_like($io_method, $psql,
355361
# "batch_start() leak & cleanup after abort",
356-
# qq(BEGIN;SELECT batch_start(); ROLLBACK;),
362+
# qq(BEGIN;$batch_start_sql; ROLLBACK;),
357363
# qr/^$/,
358364
# qr/open AIO batch at end/, "$io_method: leaky batch_start() warns");
359365

@@ -362,7 +368,7 @@ sub test_batchmode
362368
$io_method,
363369
$psql,
364370
"batch_start(), batch_end() works",
365-
qq(SELECT batch_start()UNION ALL SELECT batch_end()),
371+
qq($batch_start_sqlUNION ALL SELECTWHEREbatch_end() IS NULL),
366372
qr/^$/,
367373
qr/^$/,
368374
"$io_method: batch_start(), batch_end()");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp