Skip to content

Commit 7baa481

Browse files
test: filter warnings for disabled instances
There are several ConnectionPool tests that stop some pool instances and verify that everything works fine even for semi-functional cluster. Different network and cluster state warning are issued in this case. They are expected and not informative, thus it is better to filter them in final output. Closes #250
1 parent c8b379d commit 7baa481

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/suites/test_pool.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
import warnings
55

66
import tarantool
7-
from tarantool.error import PoolTolopogyError, DatabaseError, NetworkError
7+
from tarantool.error import (
8+
ClusterConnectWarning,
9+
DatabaseError,
10+
NetworkError,
11+
NetworkWarning,
12+
PoolTolopogyError,
13+
PoolTolopogyWarning,
14+
)
815

916
from .lib.skip import skip_or_run_sql_test, skip_or_run_conn_pool_test
1017
from .lib.tarantool_server import TarantoolServer
@@ -489,6 +496,9 @@ def test_12_execute(self):
489496
conn_0.close()
490497

491498
def test_13_failover(self):
499+
warnings.simplefilter('ignore', category=NetworkWarning)
500+
warnings.simplefilter('ignore', category=PoolTolopogyWarning)
501+
492502
self.set_cluster_ro([False, True, True, True, True])
493503
self.pool = tarantool.ConnectionPool(
494504
addrs=self.addrs,
@@ -508,6 +518,8 @@ def expect_RW_request_execute_on_new_master():
508518
self.retry(func=expect_RW_request_execute_on_new_master)
509519

510520
def test_14_cluster_with_instances_dead_in_runtime_is_ok(self):
521+
warnings.simplefilter('ignore', category=ClusterConnectWarning)
522+
511523
self.set_cluster_ro([False, True, False, True, True])
512524
self.servers[0].stop()
513525

@@ -520,6 +532,8 @@ def test_14_cluster_with_instances_dead_in_runtime_is_ok(self):
520532
self.pool.ping(mode=tarantool.Mode.RW)
521533

522534
def test_15_cluster_with_dead_instances_on_start_is_ok(self):
535+
warnings.simplefilter('ignore', category=ClusterConnectWarning)
536+
523537
self.set_cluster_ro([False, True, True, True, True])
524538
self.servers[0].stop()
525539

0 commit comments

Comments
 (0)