Fix coordinator test
This commit is contained in:
parent
34b2e360a9
commit
da3db9f3bc
@ -44,9 +44,9 @@ MEMGRAPH_INSTANCES_DESCRIPTION = {
|
|||||||
"args": ["--bolt-port", "7690", "--log-level=TRACE", "--coordinator"],
|
"args": ["--bolt-port", "7690", "--log-level=TRACE", "--coordinator"],
|
||||||
"log_file": "replica3.log",
|
"log_file": "replica3.log",
|
||||||
"setup_queries": [
|
"setup_queries": [
|
||||||
"REGISTER INSTANCE instance_1 ON '127.0.0.1:100011' WITH '127.0.0.1:10001';",
|
"REGISTER INSTANCE instance_1 ON '127.0.0.1:10011' WITH '127.0.0.1:10001';",
|
||||||
"REGISTER INSTANCE instance_2 ON '127.0.0.1:100012' WITH '127.0.0.1:10002';",
|
"REGISTER INSTANCE instance_2 ON '127.0.0.1:10012' WITH '127.0.0.1:10002';",
|
||||||
"REGISTER INSTANCE instance_3 ON '127.0.0.1:100013' WITH '127.0.0.1:10003';",
|
"REGISTER INSTANCE instance_3 ON '127.0.0.1:10013' WITH '127.0.0.1:10003';",
|
||||||
"SET INSTANCE instance_3 TO MAIN",
|
"SET INSTANCE instance_3 TO MAIN",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -156,7 +156,10 @@ def test_registering_replica_fails_endpoint_exists(connection):
|
|||||||
coord_cursor,
|
coord_cursor,
|
||||||
"REGISTER INSTANCE instance_5 ON '127.0.0.1:10001' WITH '127.0.0.1:10013';",
|
"REGISTER INSTANCE instance_5 ON '127.0.0.1:10001' WITH '127.0.0.1:10013';",
|
||||||
)
|
)
|
||||||
assert str(e.value) == "Couldn't register replica instance since instance with such endpoint already exists!"
|
assert (
|
||||||
|
str(e.value)
|
||||||
|
== "Couldn't register replica because promotion on replica failed! Check logs on replica to find out more info!"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -41,13 +41,13 @@ def test_coordinator_show_replication_cluster(connection):
|
|||||||
cursor = connection(7690, "coordinator").cursor()
|
cursor = connection(7690, "coordinator").cursor()
|
||||||
|
|
||||||
def retrieve_data():
|
def retrieve_data():
|
||||||
return set(execute_and_fetch_all(cursor, "SHOW REPLICATION CLUSTER;"))
|
return sorted(list(execute_and_fetch_all(cursor, "SHOW REPLICATION CLUSTER;")))
|
||||||
|
|
||||||
expected_data = {
|
expected_data = [
|
||||||
("main", "127.0.0.1:10013", True, "main"),
|
("instance_1", "127.0.0.1:10011", True, "replica"),
|
||||||
("replica_1", "127.0.0.1:10011", True, "replica"),
|
("instance_2", "127.0.0.1:10012", True, "replica"),
|
||||||
("replica_2", "127.0.0.1:10012", True, "replica"),
|
("instance_3", "127.0.0.1:10013", True, "main"),
|
||||||
}
|
]
|
||||||
mg_sleep_and_assert(expected_data, retrieve_data)
|
mg_sleep_and_assert(expected_data, retrieve_data)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user