Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5760d42

Browse files
committed
2 parents 0608a9d + 9d5096e commit 5760d42

File tree

6 files changed

+58
-25
lines changed

6 files changed

+58
-25
lines changed

contrib/mmts/tests2/blockade.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ containers:
2929
ports:
3030
5434: 5432
3131

32+
network:
33+
driver: udn
3234

contrib/mmts/tests2/docker-entrypoint.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,18 @@ if [ "$1" = 'postgres' ]; then
7171
max_replication_slots = 10
7272
max_wal_senders = 10
7373
shared_preload_libraries = 'raftable,multimaster'
74+
7475
raftable.id = $NODE_ID
7576
raftable.peers = '$RAFT_PEERS'
76-
multimaster.workers=4
77-
multimaster.use_raftable=true
77+
78+
multimaster.workers = 4
79+
multimaster.use_raftable = true
7880
multimaster.queue_size=52857600
79-
multimaster.ignore_tables_without_pk=1
81+
multimaster.ignore_tables_without_pk = 1
8082
multimaster.node_id = $NODE_ID
8183
multimaster.conn_strings = '$CONNSTRS'
84+
multimaster.heartbeat_recv_timeout = 1000
85+
multimaster.heartbeat_send_timeout = 250
8286
EOF
8387

8488
tail -n 20 $PGDATA/postgresql.conf

contrib/mmts/tests2/lib/bank_client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ def start(self):
2727
client.start()
2828

2929
def stop(self):
30-
print('collection stop called', self._clients)
3130
for client in self._clients:
32-
print('stop coll')
3331
client.stop()
3432

3533

@@ -160,8 +158,8 @@ def start(self):
160158
def stop(self):
161159
print('Stopping!');
162160
self.run.value = False
163-
self.total_process.join()
164-
self.transfer_process.join()
161+
self.total_process.terminate()
162+
self.transfer_process.terminate()
165163
return
166164

167165
def cleanup(self):

contrib/mmts/tests2/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
git+https://github.com/kelvich/blockade.git
1+
git+https://github.com/kelvich/blockade.git@user-defined-network
22
psycopg2

contrib/mmts/tests2/test_recovery.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ def test_1_node_disconnect(self):
3636
subprocess.check_call(['blockade','partition','node3'])
3737
print('Node3 disconnected')
3838

39-
print('Waiting 12s to discover failure')
40-
time.sleep(12)
39+
print('Waiting 20s to discover failure')
40+
time.sleep(20)
4141
for client in self.clients:
4242
agg = client.history.aggregate()
4343
print(agg)
4444

45-
print('Waiting 3s to check operability')
46-
time.sleep(3)
47-
for client in self.clients:
48-
agg = client.history.aggregate()
49-
print(agg)
50-
51-
subprocess.check_call(['blockade','join'])
52-
print('Node3 connected back')
53-
54-
print('Waiting 12s for catch-up')
55-
time.sleep(12)
56-
57-
for client in self.clients:
58-
agg = client.history.aggregate()
59-
print(agg)
45+
# print('Waiting 3s to check operability')
46+
# time.sleep(3)
47+
# for client in self.clients:
48+
# agg = client.history.aggregate()
49+
# print(agg)
50+
#
51+
# subprocess.check_call(['blockade','join'])
52+
# print('Node3 connected back')
53+
#
54+
# print('Waiting 12s for catch-up')
55+
# time.sleep(12)
56+
#
57+
# for client in self.clients:
58+
# agg = client.history.aggregate()
59+
# print(agg)
6060

6161

6262
if __name__ == '__main__':

contrib/raftable/tests/test_recovery.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,35 @@ def test_1_node_disconnect(self):
4444
# check we didn't stuck in set op
4545
self.assertTrue(agg['setkey']['running_latency'] < 3)
4646

47+
def test_1_node_in_node_out(self):
48+
print('### InOutTest ###')
49+
50+
subprocess.check_call(['blockade','partition','node3'])
51+
print('Node3 disconnected')
52+
53+
print('Waiting 5s')
54+
time.sleep(5)
55+
56+
for client in self.clients:
57+
agg = client.history.aggregate()
58+
print(agg)
59+
# check we didn't stuck in set op
60+
self.assertTrue(agg['setkey']['running_latency'] < 3)
61+
62+
subprocess.check_call(['blockade','join'])
63+
print('Node3 connected')
64+
65+
print('Waiting 5s')
66+
time.sleep(5)
67+
68+
for client in self.clients:
69+
agg = client.history.aggregate()
70+
print(agg)
71+
# check we didn't stuck in set op
72+
self.assertTrue(agg['setkey']['running_latency'] < 3)
73+
74+
75+
4776
if __name__ == '__main__':
4877
unittest.main()
4978

0 commit comments

Comments
 (0)