Make subscription tests pass with log_error_verbosity=verbose
authorAndrew Dunstan <[email protected]>
Sun, 12 Jun 2022 13:17:17 +0000 (09:17 -0400)
committerAndrew Dunstan <[email protected]>
Sun, 12 Jun 2022 13:17:17 +0000 (09:17 -0400)
Recent additions to the subscription tests check for log entries, but
fail to account for the possible presence of an SQL errror code, which
happens if log_error_verbosity is set to 'verbose'. Add this into the
regular expressions that are checked for.

src/test/subscription/t/027_nosuperuser.pl
src/test/subscription/t/029_on_error.pl

index 350bc40efcbe08e5f7018acf2df5bf12fd480708..96ec23aab704c2dd1ef256fba7b39c7db64f046a 100644 (file)
@@ -179,7 +179,7 @@ revoke_superuser("regress_admin");
 publish_update("alice.unpartitioned", 5 => 9);
 expect_failure(
    "alice.unpartitioned", 2, 5, 7,
-   qr/ERROR:  permission denied for table unpartitioned/msi,
+   qr/ERROR: ( [A-Z0-9]+:)? permission denied for table unpartitioned/msi,
    "non-superuser admin fails to replicate update");
 grant_superuser("regress_admin");
 expect_replication("alice.unpartitioned", 2, 7, 9,
@@ -214,7 +214,7 @@ expect_failure(
    3,
    7,
    11,
-   qr/ERROR:  permission denied for table unpartitioned/msi,
+   qr/ERROR: ( [A-Z0-9]+:)? permission denied for table unpartitioned/msi,
    "non-superuser admin without SELECT privileges fails to replicate update"
 );
 
@@ -262,7 +262,7 @@ expect_failure(
    2,
    11,
    13,
-   qr/ERROR:  "regress_admin" cannot replicate into relation with row-level security enabled: "unpartitioned\w*"/msi,
+   qr/ERROR: ( [A-Z0-9]+:)? "regress_admin" cannot replicate into relation with row-level security enabled: "unpartitioned\w*"/msi,
    "non-superuser admin fails to replicate insert into rls enabled table");
 grant_superuser("regress_admin");
 expect_replication("alice.unpartitioned", 3, 11, 15,
@@ -276,7 +276,7 @@ expect_failure(
    3,
    11,
    15,
-   qr/ERROR:  "regress_admin" cannot replicate into relation with row-level security enabled: "unpartitioned\w*"/msi,
+   qr/ERROR: ( [A-Z0-9]+:)? "regress_admin" cannot replicate into relation with row-level security enabled: "unpartitioned\w*"/msi,
    "non-superuser admin fails to replicate update into rls enabled unpartitioned"
 );
 
@@ -291,7 +291,7 @@ expect_failure(
    3,
    13,
    17,
-   qr/ERROR:  "regress_admin" cannot replicate into relation with row-level security enabled: "unpartitioned\w*"/msi,
+   qr/ERROR: ( [A-Z0-9]+:)? "regress_admin" cannot replicate into relation with row-level security enabled: "unpartitioned\w*"/msi,
    "non-superuser admin without bypassrls fails to replicate delete into rls enabled unpartitioned"
 );
 grant_bypassrls("regress_admin");
index e8b904b7452cde49fe1839aef409fef76dcf67aa..303e8ec3fc2461a5a824fd3d9cd541f827eb2033 100644 (file)
@@ -48,7 +48,7 @@ sub test_skip_lsn
    # Check the log to ensure that the transaction is skipped, and advance the
    # offset of the log file for the next test.
    $offset = $node_subscriber->wait_for_log(
-       qr/LOG:  done skipping logical replication transaction finished at $lsn/,
+       qr/LOG: ( [A-Z0-9]+:)? done skipping logical replication transaction finished at $lsn/,
        $offset);
 
    # Insert non-conflict data