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

Commitbc1002f

Browse files
committed
Additional subscription catchup test
1 parentf652bf4 commitbc1002f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎tests/test_simple.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,29 @@ def test_logical_replication(self):
457457
res=node2.execute('select * from test2')
458458
self.assertListEqual(res, [('a',), ('b',)])
459459

460+
@unittest.skipUnless(pg_version_ge('10'),'requires 10+')
461+
deftest_logical_catchup(self):
462+
""" Runs catchup for 100 times to be sure that it is consistent """
463+
withget_new_node()asnode1,get_new_node()asnode2:
464+
node1.init(allow_logical=True)
465+
node1.start()
466+
node2.init().start()
467+
468+
create_table='create table test (key int primary key, val int); '
469+
node1.safe_psql(create_table)
470+
node1.safe_psql('alter table test replica identity default')
471+
node2.safe_psql(create_table)
472+
473+
# create publication / create subscription
474+
sub=node2.subscribe(node1.publish('mypub'),'mysub')
475+
476+
foriinrange(0,100):
477+
node1.execute('insert into test values ({0}, {0})'.format(i))
478+
sub.catchup()
479+
res=node2.execute('select * from test')
480+
self.assertListEqual(res, [(i,i,)])
481+
node1.execute('delete from test')
482+
460483
@unittest.skipIf(pg_version_ge('10'),'requires <10')
461484
deftest_logical_replication_fail(self):
462485
withget_new_node()asnode:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp