Skip to content

Commit bdaa2ec

Browse files
committed
test: replication-py/init_storage.test.py
Found that test failed in 2 common places when it tried to start the replica and wait it within 'JOIN' either 'SUBSCRIBE' test parts. It used to wait for replica start check the 'wait_until_started()' function 'TarantoolServer' class from test-run repository. But it didn't try resolve connection issues on replica creation, like: [30534] main/103/replica I> connecting to 1 replicas [30534] main/112/applier/localhost:49168 I> can't connect to master [30534] main/112/applier/localhost:49168 sio.c:208 !> SystemError connect to 127.0.0.1:49168, called on fd 27, aka 127.0.0.1:47954: Connection refused [30534] main/112/applier/localhost:49168 I> will retry every 0.10 second [30534] main/112/applier/localhost:49168 I> remote master c5d480c3-219c-11eb-ac14-080027727614 at 127.0.0.1:49168 running Tarantool 2.7.0 [30534] main/103/replica I> connected to 1 replicas [30534] main/103/replica I> bootstrapping replica from c5d480c3-219c-11eb-ac14-080027727614 at 127.0.0.1:49168 [30534] main/112/applier/localhost:49168 I> can't read row [30534] main/112/applier/localhost:49168 box.cc:183 E> ER_READONLY: Can't modify data because this instance is in read-only mode. [30534] main/103/replica box.cc:183 E> ER_READONLY: Can't modify data because this instance is in read-only mode. [30534] main/103/replica F> can't initialize storage: Can't modify data because this instance is in read-only mode. [30534] main/103/replica F> can't initialize storage: Can't modify data because this instance is in read-only mode. To resolve it the test was changed to be able to catch exception 'TarantoolStartError' from test-run. Also the test should have the ability to be restarted by test-run using fragile list and in this way 'crash_expected' flag was disabled to let the test fail with exception. Needed by #4949
1 parent 5d969fd commit bdaa2ec

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

test/replication-py/init_storage.test.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import glob
3+
from lib.tarantool_server import TarantoolStartError
34
from lib.tarantool_server import TarantoolServer
45

56
# master server
@@ -64,17 +65,35 @@
6465

6566
print 'waiting reconnect on JOIN...'
6667
server.start()
67-
replica.wait_until_started()
68-
print 'ok'
68+
try:
69+
# Replica may fail to start due connection issues may occur, check
70+
# gh-4949. Also the test should have the ability to be restarted by
71+
# test-run using fragile list and in this way 'crash_expected' flag
72+
# should be disabled to let the test fail with exception.
73+
replica.crash_expected = True
74+
replica.wait_until_started()
75+
except TarantoolStartError:
76+
print 'not ok - server failed to start'
77+
else:
78+
print 'ok'
6979

7080
replica.stop()
7181
server.stop()
7282

7383
print 'waiting reconnect on SUBSCRIBE...'
7484
replica.start(wait=False)
7585
server.start()
76-
replica.wait_until_started()
77-
print 'ok'
86+
try:
87+
# Replica may fail to start due connection issues may occur, check
88+
# gh-4949. Also the test should have the ability to be restarted by
89+
# test-run using fragile list and in this way 'crash_expected' flag
90+
# should be disabled to let the test fail with exception.
91+
replica.crash_expected = True
92+
replica.wait_until_started()
93+
except TarantoolStartError:
94+
print 'not ok - server failed to start'
95+
else:
96+
print 'ok'
7897

7998
replica.stop()
8099
replica.cleanup()

test/replication-py/suite.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ script = master.lua
44
description = tarantool/box, replication
55
is_parallel = True
66
fragile = {
7-
"retries": 10,
7+
"retries": 50,
88
"tests": {
99
"init_storage.test.py": {
10-
"issues": [ "gh-4949" ]
10+
"issues": [ "gh-4949" ],
11+
"checksums": [ "9b4235bb6bb9d76aa6a1f7dc8f088075", "4c5fc871955a3166d67fbfa9f254f68a", "bc2781acdb5745d01da2f533a0d519f9" ]
1112
},
1213
"conflict.test.py": {
1314
"issues": [ "gh-4980" ]

0 commit comments

Comments
 (0)