* [Tarantool-patches] [PATCH v2] test: replication-py/init_storage.test.py
@ 2020-12-02 20:20 Alexander V. Tikhonov
2020-12-03 7:49 ` Serge Petrenko
2020-12-04 10:51 ` Kirill Yukhin
0 siblings, 2 replies; 3+ messages in thread
From: Alexander V. Tikhonov @ 2020-12-02 20:20 UTC (permalink / raw)
To: Serge Petrenko, Kirill Yukhin; +Cc: tarantool-patches
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 enabled to let the test fail with exception.
Needed by #4949
---
Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4949
Issue: https://github.com/tarantool/tarantool/issues/4949
test/replication-py/init_storage.test.py | 27 ++++++++++++++++++++----
test/replication-py/suite.ini | 3 ++-
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/test/replication-py/init_storage.test.py b/test/replication-py/init_storage.test.py
index 4be531f8d..f8641bf65 100644
--- a/test/replication-py/init_storage.test.py
+++ b/test/replication-py/init_storage.test.py
@@ -1,5 +1,6 @@
import os
import glob
+from lib.tarantool_server import TarantoolStartError
from lib.tarantool_server import TarantoolServer
# master server
@@ -64,8 +65,17 @@ replica.deploy(wait=False)
print 'waiting reconnect on JOIN...'
server.start()
-replica.wait_until_started()
-print 'ok'
+try:
+ # Replica may fail to start due connection issues may occur, check
+ # gh-4949. Also the test should have the ability to be restarted by
+ # test-run using fragile list and in this way 'crash_expected' flag
+ # should be enabled to let the test fail with exception.
+ replica.crash_expected = True
+ replica.wait_until_started()
+except TarantoolStartError:
+ print 'not ok - server failed to start'
+else:
+ print 'ok'
replica.stop()
server.stop()
@@ -73,8 +83,17 @@ server.stop()
print 'waiting reconnect on SUBSCRIBE...'
replica.start(wait=False)
server.start()
-replica.wait_until_started()
-print 'ok'
+try:
+ # Replica may fail to start due connection issues may occur, check
+ # gh-4949. Also the test should have the ability to be restarted by
+ # test-run using fragile list and in this way 'crash_expected' flag
+ # should be enabled to let the test fail with exception.
+ replica.crash_expected = True
+ replica.wait_until_started()
+except TarantoolStartError:
+ print 'not ok - server failed to start'
+else:
+ print 'ok'
replica.stop()
replica.cleanup()
diff --git a/test/replication-py/suite.ini b/test/replication-py/suite.ini
index b563b9fca..6cc497747 100644
--- a/test/replication-py/suite.ini
+++ b/test/replication-py/suite.ini
@@ -7,7 +7,8 @@ fragile = {
"retries": 10,
"tests": {
"init_storage.test.py": {
- "issues": [ "gh-4949" ]
+ "issues": [ "gh-4949" ],
+ "checksums": [ "9b4235bb6bb9d76aa6a1f7dc8f088075", "4c5fc871955a3166d67fbfa9f254f68a", "bc2781acdb5745d01da2f533a0d519f9" ]
},
"conflict.test.py": {
"issues": [ "gh-4980" ]
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Tarantool-patches] [PATCH v2] test: replication-py/init_storage.test.py
2020-12-02 20:20 [Tarantool-patches] [PATCH v2] test: replication-py/init_storage.test.py Alexander V. Tikhonov
@ 2020-12-03 7:49 ` Serge Petrenko
2020-12-04 10:51 ` Kirill Yukhin
1 sibling, 0 replies; 3+ messages in thread
From: Serge Petrenko @ 2020-12-03 7:49 UTC (permalink / raw)
To: Alexander V. Tikhonov, Kirill Yukhin; +Cc: tarantool-patches
02.12.2020 23:20, Alexander V. Tikhonov пишет:
> 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 enabled to let the test fail with exception.
>
> Needed by #4949
> ---
Thanks for the fixes!
LGTM.
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4949
> Issue: https://github.com/tarantool/tarantool/issues/4949
>
> test/replication-py/init_storage.test.py | 27 ++++++++++++++++++++----
> test/replication-py/suite.ini | 3 ++-
> 2 files changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/test/replication-py/init_storage.test.py b/test/replication-py/init_storage.test.py
> index 4be531f8d..f8641bf65 100644
> --- a/test/replication-py/init_storage.test.py
> +++ b/test/replication-py/init_storage.test.py
> @@ -1,5 +1,6 @@
> import os
> import glob
> +from lib.tarantool_server import TarantoolStartError
> from lib.tarantool_server import TarantoolServer
>
> # master server
> @@ -64,8 +65,17 @@ replica.deploy(wait=False)
>
> print 'waiting reconnect on JOIN...'
> server.start()
> -replica.wait_until_started()
> -print 'ok'
> +try:
> + # Replica may fail to start due connection issues may occur, check
> + # gh-4949. Also the test should have the ability to be restarted by
> + # test-run using fragile list and in this way 'crash_expected' flag
> + # should be enabled to let the test fail with exception.
> + replica.crash_expected = True
> + replica.wait_until_started()
> +except TarantoolStartError:
> + print 'not ok - server failed to start'
> +else:
> + print 'ok'
>
> replica.stop()
> server.stop()
> @@ -73,8 +83,17 @@ server.stop()
> print 'waiting reconnect on SUBSCRIBE...'
> replica.start(wait=False)
> server.start()
> -replica.wait_until_started()
> -print 'ok'
> +try:
> + # Replica may fail to start due connection issues may occur, check
> + # gh-4949. Also the test should have the ability to be restarted by
> + # test-run using fragile list and in this way 'crash_expected' flag
> + # should be enabled to let the test fail with exception.
> + replica.crash_expected = True
> + replica.wait_until_started()
> +except TarantoolStartError:
> + print 'not ok - server failed to start'
> +else:
> + print 'ok'
>
> replica.stop()
> replica.cleanup()
> diff --git a/test/replication-py/suite.ini b/test/replication-py/suite.ini
> index b563b9fca..6cc497747 100644
> --- a/test/replication-py/suite.ini
> +++ b/test/replication-py/suite.ini
> @@ -7,7 +7,8 @@ fragile = {
> "retries": 10,
> "tests": {
> "init_storage.test.py": {
> - "issues": [ "gh-4949" ]
> + "issues": [ "gh-4949" ],
> + "checksums": [ "9b4235bb6bb9d76aa6a1f7dc8f088075", "4c5fc871955a3166d67fbfa9f254f68a", "bc2781acdb5745d01da2f533a0d519f9" ]
> },
> "conflict.test.py": {
> "issues": [ "gh-4980" ]
--
Serge Petrenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Tarantool-patches] [PATCH v2] test: replication-py/init_storage.test.py
2020-12-02 20:20 [Tarantool-patches] [PATCH v2] test: replication-py/init_storage.test.py Alexander V. Tikhonov
2020-12-03 7:49 ` Serge Petrenko
@ 2020-12-04 10:51 ` Kirill Yukhin
1 sibling, 0 replies; 3+ messages in thread
From: Kirill Yukhin @ 2020-12-04 10:51 UTC (permalink / raw)
To: Alexander V. Tikhonov; +Cc: tarantool-patches
Hello,
On 02 Dec 23:20, Alexander V. Tikhonov wrote:
> 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 enabled to let the test fail with exception.
>
> Needed by #4949
> ---
>
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4949
> Issue: https://github.com/tarantool/tarantool/issues/4949
I've checked your patch into 1.10, 2.5, 2.6 and master.
--
Regards, Kirill Yukhin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-04 10:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 20:20 [Tarantool-patches] [PATCH v2] test: replication-py/init_storage.test.py Alexander V. Tikhonov
2020-12-03 7:49 ` Serge Petrenko
2020-12-04 10:51 ` Kirill Yukhin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox