[tarantool-patches] [PATCH v1 6/6] Fix wait_fullmesh

avtikhon avtikhon at tarantool.org
Mon Apr 1 17:13:35 MSK 2019


From: avtikhon <avtikhon at gmail.com>

Changed wait_fullmesh local routine to the common routine at the
test-run repository, where the fullmesh routine restarts itself
on clusters connecting tests.
---
 test/replication/autobootstrap.result              |  8 +-------
 test/replication/autobootstrap.test.lua            |  7 +------
 test/replication/autobootstrap_guest.result        |  8 +-------
 test/replication/autobootstrap_guest.test.lua      |  7 +------
 test/replication/before_replace.result             |  5 +----
 test/replication/before_replace.test.lua           |  3 +--
 test/replication/ddl.result                        |  5 +----
 test/replication/ddl.test.lua                      |  3 +--
 test/replication/misc.result                       |  5 +----
 test/replication/misc.test.lua                     |  3 +--
 test/replication/on_replace.result                 |  5 +----
 test/replication/on_replace.test.lua               |  3 +--
 test/replication/quorum.result                     | 10 ++--------
 test/replication/quorum.test.lua                   |  6 ++----
 test/replication/rebootstrap.result                |  5 +----
 test/replication/rebootstrap.test.lua              |  3 +--
 test/replication/recover_missing_xlog.result       |  5 +----
 test/replication/recover_missing_xlog.test.lua     |  3 +--
 test/replication/show_error_on_disconnect.result   |  5 +----
 test/replication/show_error_on_disconnect.test.lua |  3 +--
 20 files changed, 22 insertions(+), 80 deletions(-)

diff --git a/test/replication/autobootstrap.result b/test/replication/autobootstrap.result
index 7b770a5ea..67e2f8892 100644
--- a/test/replication/autobootstrap.result
+++ b/test/replication/autobootstrap.result
@@ -13,13 +13,7 @@ SERVERS = { 'autobootstrap1', 'autobootstrap2', 'autobootstrap3' }
 --
 -- Start servers
 --
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
---
--- Wait for full mesh
---
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 --
diff --git a/test/replication/autobootstrap.test.lua b/test/replication/autobootstrap.test.lua
index 3b1397eb5..ca50c8800 100644
--- a/test/replication/autobootstrap.test.lua
+++ b/test/replication/autobootstrap.test.lua
@@ -8,12 +8,7 @@ SERVERS = { 'autobootstrap1', 'autobootstrap2', 'autobootstrap3' }
 --
 -- Start servers
 --
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-
---
--- Wait for full mesh
---
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 
 --
 -- Check vclock
diff --git a/test/replication/autobootstrap_guest.result b/test/replication/autobootstrap_guest.result
index dc1098765..ff76434c7 100644
--- a/test/replication/autobootstrap_guest.result
+++ b/test/replication/autobootstrap_guest.result
@@ -10,13 +10,7 @@ SERVERS = { 'autobootstrap_guest1', 'autobootstrap_guest2', 'autobootstrap_guest
 --
 -- Start servers
 --
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
---
--- Wait for full mesh
---
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 --
diff --git a/test/replication/autobootstrap_guest.test.lua b/test/replication/autobootstrap_guest.test.lua
index 23329811c..f53785610 100644
--- a/test/replication/autobootstrap_guest.test.lua
+++ b/test/replication/autobootstrap_guest.test.lua
@@ -6,12 +6,7 @@ SERVERS = { 'autobootstrap_guest1', 'autobootstrap_guest2', 'autobootstrap_guest
 --
 -- Start servers
 --
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-
---
--- Wait for full mesh
---
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 
 --
 -- Check vclock
diff --git a/test/replication/before_replace.result b/test/replication/before_replace.result
index 5b0cf1382..fa8d57d28 100644
--- a/test/replication/before_replace.result
+++ b/test/replication/before_replace.result
@@ -11,10 +11,7 @@ SERVERS = { 'before_replace1', 'before_replace2', 'before_replace3' }
 ---
 ...
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 -- Setup space:before_replace trigger on all replicas.
diff --git a/test/replication/before_replace.test.lua b/test/replication/before_replace.test.lua
index 7cb1c5516..b938a631f 100644
--- a/test/replication/before_replace.test.lua
+++ b/test/replication/before_replace.test.lua
@@ -7,8 +7,7 @@ engine = test_run:get_cfg('engine')
 SERVERS = { 'before_replace1', 'before_replace2', 'before_replace3' }
 
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 
 -- Setup space:before_replace trigger on all replicas.
 -- The trigger favors tuples with a greater value.
diff --git a/test/replication/ddl.result b/test/replication/ddl.result
index 8cd54cdfb..01d2b039e 100644
--- a/test/replication/ddl.result
+++ b/test/replication/ddl.result
@@ -5,10 +5,7 @@ SERVERS = { 'ddl1', 'ddl2', 'ddl3', 'ddl4' }
 ---
 ...
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 test_run:cmd("switch ddl1")
diff --git a/test/replication/ddl.test.lua b/test/replication/ddl.test.lua
index f56071adc..e31894352 100644
--- a/test/replication/ddl.test.lua
+++ b/test/replication/ddl.test.lua
@@ -3,8 +3,7 @@ test_run = require('test_run').new()
 SERVERS = { 'ddl1', 'ddl2', 'ddl3', 'ddl4' }
 
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 test_run:cmd("switch ddl1")
 test_run = require('test_run').new()
 fiber = require('fiber')
diff --git a/test/replication/misc.result b/test/replication/misc.result
index 6ce830eaa..c202dc729 100644
--- a/test/replication/misc.result
+++ b/test/replication/misc.result
@@ -100,10 +100,7 @@ SERVERS = { 'misc1', 'misc2', 'misc3' }
 ---
 ...
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 test_run:cmd("switch misc1")
diff --git a/test/replication/misc.test.lua b/test/replication/misc.test.lua
index d056d30a1..8446c1896 100644
--- a/test/replication/misc.test.lua
+++ b/test/replication/misc.test.lua
@@ -39,8 +39,7 @@ test_run:cleanup_cluster()
 SERVERS = { 'misc1', 'misc2', 'misc3' }
 
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 test_run:cmd("switch misc1")
 test_run = require('test_run').new()
 box.cfg{replication_timeout = 0.03, replication_connect_timeout=0.03}
diff --git a/test/replication/on_replace.result b/test/replication/on_replace.result
index f5d03ab9b..9458d335c 100644
--- a/test/replication/on_replace.result
+++ b/test/replication/on_replace.result
@@ -105,10 +105,7 @@ box.schema.user.revoke('guest', 'replication')
 SERVERS = { 'on_replace1', 'on_replace2' }
 ---
 ...
-test_run:create_cluster(SERVERS, "replication", {args="0.2"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.2"})
 ---
 ...
 test_run:cmd('switch on_replace1')
diff --git a/test/replication/on_replace.test.lua b/test/replication/on_replace.test.lua
index 416c93e38..c9d413213 100644
--- a/test/replication/on_replace.test.lua
+++ b/test/replication/on_replace.test.lua
@@ -46,8 +46,7 @@ box.schema.user.revoke('guest', 'replication')
 -- gh-2798 on_replace on slave server with non-local data change should fail
 
 SERVERS = { 'on_replace1', 'on_replace2' }
-test_run:create_cluster(SERVERS, "replication", {args="0.2"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.2"})
 
 test_run:cmd('switch on_replace1')
 fiber = require'fiber'
diff --git a/test/replication/quorum.result b/test/replication/quorum.result
index d569d15ad..ae9520269 100644
--- a/test/replication/quorum.result
+++ b/test/replication/quorum.result
@@ -5,10 +5,7 @@ SERVERS = {'quorum1', 'quorum2', 'quorum3'}
 ---
 ...
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 -- Stop one replica and try to restart another one.
@@ -356,10 +353,7 @@ SERVERS = {'master_quorum1', 'master_quorum2'}
 ---
 ...
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 test_run:cmd("switch master_quorum1")
diff --git a/test/replication/quorum.test.lua b/test/replication/quorum.test.lua
index e32228d29..46962969e 100644
--- a/test/replication/quorum.test.lua
+++ b/test/replication/quorum.test.lua
@@ -3,8 +3,7 @@ test_run = require('test_run').new()
 SERVERS = {'quorum1', 'quorum2', 'quorum3'}
 
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 
 -- Stop one replica and try to restart another one.
 -- It should successfully restart, but stay in the
@@ -136,8 +135,7 @@ box.schema.user.revoke('guest', 'replication')
 -- Second case, check that master-master works.
 SERVERS = {'master_quorum1', 'master_quorum2'}
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 test_run:cmd("switch master_quorum1")
 repl = box.cfg.replication
 box.cfg{replication = ""}
diff --git a/test/replication/rebootstrap.result b/test/replication/rebootstrap.result
index 3f27f29d6..3cbab9b78 100644
--- a/test/replication/rebootstrap.result
+++ b/test/replication/rebootstrap.result
@@ -4,10 +4,7 @@ test_run = require('test_run').new()
 SERVERS = {'rebootstrap1', 'rebootstrap2'}
 ---
 ...
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 --
diff --git a/test/replication/rebootstrap.test.lua b/test/replication/rebootstrap.test.lua
index d38d165bd..52b7276bf 100644
--- a/test/replication/rebootstrap.test.lua
+++ b/test/replication/rebootstrap.test.lua
@@ -2,8 +2,7 @@ test_run = require('test_run').new()
 
 SERVERS = {'rebootstrap1', 'rebootstrap2'}
 
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 
 --
 -- gh-3422: If quorum can't be formed, because some replicas are
diff --git a/test/replication/recover_missing_xlog.result b/test/replication/recover_missing_xlog.result
index 5292bcb3d..1128aa50e 100644
--- a/test/replication/recover_missing_xlog.result
+++ b/test/replication/recover_missing_xlog.result
@@ -4,10 +4,7 @@ test_run = require('test_run').new()
 SERVERS = { 'recover_missing_xlog1', 'recover_missing_xlog2', 'recover_missing_xlog3' }
 ---
 ...
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 test_run:cmd("switch recover_missing_xlog1")
diff --git a/test/replication/recover_missing_xlog.test.lua b/test/replication/recover_missing_xlog.test.lua
index 1a340f41b..1d4c846b6 100644
--- a/test/replication/recover_missing_xlog.test.lua
+++ b/test/replication/recover_missing_xlog.test.lua
@@ -1,8 +1,7 @@
 test_run = require('test_run').new()
 
 SERVERS = { 'recover_missing_xlog1', 'recover_missing_xlog2', 'recover_missing_xlog3' }
-test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 
 test_run:cmd("switch recover_missing_xlog1")
 for i = 0, 9 do box.space.test:insert{i, 'test' .. i} end
diff --git a/test/replication/show_error_on_disconnect.result b/test/replication/show_error_on_disconnect.result
index a1afd1038..09dfa00b1 100644
--- a/test/replication/show_error_on_disconnect.result
+++ b/test/replication/show_error_on_disconnect.result
@@ -10,10 +10,7 @@ SERVERS = {'show_error_on_disconnect1', 'show_error_on_disconnect2'}
 ---
 ...
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS)
----
-...
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
 test_run:cmd("switch show_error_on_disconnect1")
diff --git a/test/replication/show_error_on_disconnect.test.lua b/test/replication/show_error_on_disconnect.test.lua
index abe7218d4..5b1b7232f 100644
--- a/test/replication/show_error_on_disconnect.test.lua
+++ b/test/replication/show_error_on_disconnect.test.lua
@@ -7,8 +7,7 @@ test_run = require('test_run').new()
 SERVERS = {'show_error_on_disconnect1', 'show_error_on_disconnect2'}
 
 -- Deploy a cluster.
-test_run:create_cluster(SERVERS)
-test_run:wait_fullmesh(SERVERS)
+test_run:init_cluster(SERVERS, "replication", {args="0.1"})
 test_run:cmd("switch show_error_on_disconnect1")
 repl = box.cfg.replication
 box.cfg{replication = ""}
-- 
2.17.1





More information about the Tarantool-patches mailing list