Fix a test case in 035_standby_logical_decoding.pl - Mailing list pgsql-hackers

From Yu Shi (Fujitsu)
Subject Fix a test case in 035_standby_logical_decoding.pl
Date
Msg-id OSZPR01MB6310B0A507A0F2A2D379F38CFD6A9@OSZPR01MB6310.jpnprd01.prod.outlook.com
Whole thread Raw
Responses Re: Fix a test case in 035_standby_logical_decoding.pl
List pgsql-hackers
Hi hackers,

In 035_standby_logical_decoding.pl, I think that the check in the following test
case should be performed on the standby node, instead of the primary node, as
the slot is created on the standby node. The test currently passes because it
only checks the return value of psql. It might be more appropriate to check the
error message. Please see the attached patch.

```
$node_primary->safe_psql('postgres', 'CREATE DATABASE otherdb');

is( $node_primary->psql(
        'otherdb',
        "SELECT lsn FROM pg_logical_slot_peek_changes('behaves_ok_activeslot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"
    ),
    3,
    'replaying logical slot from another database fails');
```

The regress log:
psql:<stdin>:1: ERROR:  replication slot "behaves_ok_activeslot" does not exist
[11:23:21.859](0.086s) ok 8 - replaying logical slot from another database fails

Regards,
Shi Yu

Attachment

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: pg_upgrade and logical replication
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: Fix a test case in 035_standby_logical_decoding.pl