Skip to content

Commit 20cbd9c

Browse files
committed
tests
1 parent ef499db commit 20cbd9c

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

t/001_basic_recovery.pl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
use Cluster;
44
use TestLib;
55
use Test::More tests => 3;
6-
use DBI;
7-
use DBD::Pg ':async';
86

97
my $cluster = new Cluster(3);
108
$cluster->init();
@@ -43,11 +41,13 @@
4341
diag("stopping node 2");
4442
$cluster->{nodes}->[2]->teardown_node;
4543

46-
diag("sleeping 15");
47-
sleep(15);
44+
my $ret = $cluster->psql(0, 'postgres', "insert into t values(4, 40);");
45+
diag "tx1 status = $ret";
4846

4947
diag("inserting 2");
50-
$cluster->psql(0, 'postgres', "insert into t values(2, 20);");
48+
my $ret = $cluster->psql(0, 'postgres', "insert into t values(2, 20);");
49+
diag "tx2 status = $ret";
50+
5151
diag("selecting");
5252
$cluster->psql(1, 'postgres', "select v from t where k=2;", stdout => \$psql_out);
5353
diag("selected");
@@ -58,15 +58,19 @@
5858
###############################################################################
5959

6060
diag("starting node 2");
61-
$nodes[2]->start;
62-
diag("sleeping 10");
61+
$cluster->{nodes}->[2]->start;
62+
#diag("sleeping 10");
6363
#sleep(10); # XXX: here we can poll
64+
6465
$cluster->psql(0, 'postgres', "select mtm.poll_node(3);");
6566
diag("inserting 3");
67+
6668
$cluster->psql(0, 'postgres', "insert into t values(3, 30);");
6769
diag("selecting");
70+
6871
$cluster->psql(2, 'postgres', "select v from t where k=3;", stdout => \$psql_out);
6972
diag("selected");
73+
7074
is($psql_out, '30', "Check replication after failed node recovery.");
7175

7276

testeaux/Cluster.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ sub configure
109109
multimaster.queue_size = 10485760 # 10mb
110110
multimaster.node_id = $id
111111
multimaster.conn_strings = '$connstr'
112-
multimaster.use_raftable = true
112+
multimaster.use_raftable = false
113113
multimaster.ignore_tables_without_pk = true
114-
multimaster.twopc_min_timeout = 60000
114+
multimaster.twopc_min_timeout = 10000
115115
raftable.id = $id
116116
raftable.peers = '$raftpeers'
117117
));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy