[tarantool-patches] [PATCH v2 2/2] test: added loop with restart for fullmesh routine

Alexander V. Tikhonov avtikhon at tarantool.org
Thu Mar 21 09:03:06 MSK 2019


Add loop with restart for fullmesh routine.
---
 test/replication/autobootstrap.result              | 3 ++-
 test/replication/autobootstrap.test.lua            | 2 +-
 test/replication/autobootstrap_guest.result        | 2 +-
 test/replication/autobootstrap_guest.test.lua      | 2 +-
 test/replication/before_replace.result             | 2 +-
 test/replication/before_replace.test.lua           | 2 +-
 test/replication/ddl.result                        | 2 +-
 test/replication/ddl.test.lua                      | 2 +-
 test/replication/misc.result                       | 2 +-
 test/replication/misc.test.lua                     | 2 +-
 test/replication/on_replace.result                 | 2 +-
 test/replication/on_replace.test.lua               | 2 +-
 test/replication/quorum.result                     | 4 ++--
 test/replication/quorum.test.lua                   | 4 ++--
 test/replication/rebootstrap.result                | 2 +-
 test/replication/rebootstrap.test.lua              | 2 +-
 test/replication/recover_missing_xlog.result       | 9 ++-------
 test/replication/recover_missing_xlog.test.lua     | 7 ++-----
 test/replication/replicaset_ro_mostly.result       | 1 +
 test/replication/show_error_on_disconnect.result   | 2 +-
 test/replication/show_error_on_disconnect.test.lua | 2 +-
 21 files changed, 26 insertions(+), 32 deletions(-)

diff --git a/test/replication/autobootstrap.result b/test/replication/autobootstrap.result
index 7b770a5ea..997cb4560 100644
--- a/test/replication/autobootstrap.result
+++ b/test/replication/autobootstrap.result
@@ -19,7 +19,7 @@ test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 --
 -- Wait for full mesh
 --
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 --
@@ -196,6 +196,7 @@ _ = test_run:cmd("switch default")
 ...
 test_run:wait_fullmesh(SERVERS)
 ---
+- true
 ...
 vclock = test_run:get_vclock("autobootstrap1")
 ---
diff --git a/test/replication/autobootstrap.test.lua b/test/replication/autobootstrap.test.lua
index 3b1397eb5..632a2cb13 100644
--- a/test/replication/autobootstrap.test.lua
+++ b/test/replication/autobootstrap.test.lua
@@ -13,7 +13,7 @@ test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 --
 -- Wait for full mesh
 --
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 
 --
 -- Check vclock
diff --git a/test/replication/autobootstrap_guest.result b/test/replication/autobootstrap_guest.result
index dc1098765..aa2ee8808 100644
--- a/test/replication/autobootstrap_guest.result
+++ b/test/replication/autobootstrap_guest.result
@@ -16,7 +16,7 @@ test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 --
 -- Wait for full mesh
 --
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 --
diff --git a/test/replication/autobootstrap_guest.test.lua b/test/replication/autobootstrap_guest.test.lua
index 23329811c..15f7b4ecf 100644
--- a/test/replication/autobootstrap_guest.test.lua
+++ b/test/replication/autobootstrap_guest.test.lua
@@ -11,7 +11,7 @@ test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 --
 -- Wait for full mesh
 --
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 
 --
 -- Check vclock
diff --git a/test/replication/before_replace.result b/test/replication/before_replace.result
index 1b75085ab..3a5e668df 100644
--- a/test/replication/before_replace.result
+++ b/test/replication/before_replace.result
@@ -14,7 +14,7 @@ SERVERS = { 'before_replace1', 'before_replace2', 'before_replace3' }
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 -- 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 cce2bb72e..1141e59ec 100644
--- a/test/replication/before_replace.test.lua
+++ b/test/replication/before_replace.test.lua
@@ -8,7 +8,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)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 
 -- 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..5a63f2d22 100644
--- a/test/replication/ddl.result
+++ b/test/replication/ddl.result
@@ -8,7 +8,7 @@ SERVERS = { 'ddl1', 'ddl2', 'ddl3', 'ddl4' }
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 test_run:cmd("switch ddl1")
diff --git a/test/replication/ddl.test.lua b/test/replication/ddl.test.lua
index f56071adc..09dddd5bf 100644
--- a/test/replication/ddl.test.lua
+++ b/test/replication/ddl.test.lua
@@ -4,7 +4,7 @@ SERVERS = { 'ddl1', 'ddl2', 'ddl3', 'ddl4' }
 
 -- Deploy a cluster.
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 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 45da3894d..59b779d6b 100644
--- a/test/replication/misc.result
+++ b/test/replication/misc.result
@@ -97,7 +97,7 @@ SERVERS = { 'misc1', 'misc2', 'misc3' }
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 test_run:cmd("switch misc1")
diff --git a/test/replication/misc.test.lua b/test/replication/misc.test.lua
index ec38feefa..9901d7b12 100644
--- a/test/replication/misc.test.lua
+++ b/test/replication/misc.test.lua
@@ -39,7 +39,7 @@ SERVERS = { 'misc1', 'misc2', 'misc3' }
 
 -- Deploy a cluster.
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 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 2e3df5c3f..0d3d64df0 100644
--- a/test/replication/on_replace.result
+++ b/test/replication/on_replace.result
@@ -102,7 +102,7 @@ SERVERS = { 'on_replace1', 'on_replace2' }
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 test_run:cmd('switch on_replace1')
diff --git a/test/replication/on_replace.test.lua b/test/replication/on_replace.test.lua
index d427cc766..cf7f6eedd 100644
--- a/test/replication/on_replace.test.lua
+++ b/test/replication/on_replace.test.lua
@@ -45,7 +45,7 @@ box.schema.user.revoke('guest', 'replication')
 
 SERVERS = { 'on_replace1', 'on_replace2' }
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 
 test_run:cmd('switch on_replace1')
 fiber = require'fiber'
diff --git a/test/replication/quorum.result b/test/replication/quorum.result
index 0431bf9df..07e7cec2a 100644
--- a/test/replication/quorum.result
+++ b/test/replication/quorum.result
@@ -11,7 +11,7 @@ SERVERS = {'quorum1', 'quorum2', 'quorum3'}
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 -- Stop one replica and try to restart another one.
@@ -350,7 +350,7 @@ SERVERS = {'master_quorum1', 'master_quorum2'}
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 test_run:cmd("switch master_quorum1")
diff --git a/test/replication/quorum.test.lua b/test/replication/quorum.test.lua
index 5f01bd604..e681c77ff 100644
--- a/test/replication/quorum.test.lua
+++ b/test/replication/quorum.test.lua
@@ -5,7 +5,7 @@ SERVERS = {'quorum1', 'quorum2', 'quorum3'}
 
 -- Deploy a cluster.
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 
 -- Stop one replica and try to restart another one.
 -- It should successfully restart, but stay in the
@@ -135,7 +135,7 @@ box.schema.user.revoke('guest', 'replication')
 SERVERS = {'master_quorum1', 'master_quorum2'}
 -- Deploy a cluster.
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 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 fccf16533..2144aa293 100644
--- a/test/replication/rebootstrap.result
+++ b/test/replication/rebootstrap.result
@@ -7,7 +7,7 @@ SERVERS = {'rebootstrap1', 'rebootstrap2'}
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 --
diff --git a/test/replication/rebootstrap.test.lua b/test/replication/rebootstrap.test.lua
index 1af8cbc10..48e4f3124 100644
--- a/test/replication/rebootstrap.test.lua
+++ b/test/replication/rebootstrap.test.lua
@@ -3,7 +3,7 @@ test_run = require('test_run').new()
 SERVERS = {'rebootstrap1', 'rebootstrap2'}
 
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 
 --
 -- 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 667700284..7de982502 100644
--- a/test/replication/recover_missing_xlog.result
+++ b/test/replication/recover_missing_xlog.result
@@ -1,18 +1,13 @@
-env = require('test_run')
----
-...
-test_run = env.new()
+test_run = require('test_run').new()
 ---
 ...
 SERVERS = { 'recover_missing_xlog1', 'recover_missing_xlog2', 'recover_missing_xlog3' }
 ---
 ...
--- Start servers
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
--- Wait for full mesh
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 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 4e131293c..aefe7ee10 100644
--- a/test/replication/recover_missing_xlog.test.lua
+++ b/test/replication/recover_missing_xlog.test.lua
@@ -1,11 +1,8 @@
-env = require('test_run')
-test_run = env.new()
+test_run = require('test_run').new()
 
 SERVERS = { 'recover_missing_xlog1', 'recover_missing_xlog2', 'recover_missing_xlog3' }
--- Start servers
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
--- Wait for full mesh
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 
 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/replicaset_ro_mostly.result b/test/replication/replicaset_ro_mostly.result
index 43f0b489b..57540ba1c 100644
--- a/test/replication/replicaset_ro_mostly.result
+++ b/test/replication/replicaset_ro_mostly.result
@@ -54,6 +54,7 @@ create_cluster_uuid(SERVERS, UUID)
 ...
 test_run:wait_fullmesh(SERVERS)
 ---
+- true
 ...
 -- Add third replica
 name = 'replicaset_ro_mostly3'
diff --git a/test/replication/show_error_on_disconnect.result b/test/replication/show_error_on_disconnect.result
index ae8d6a7da..ff98d60e4 100644
--- a/test/replication/show_error_on_disconnect.result
+++ b/test/replication/show_error_on_disconnect.result
@@ -13,7 +13,7 @@ SERVERS = {'show_error_on_disconnect1', 'show_error_on_disconnect2'}
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
 ---
 ...
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 ---
 ...
 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 9fad4d0f4..6a7695336 100644
--- a/test/replication/show_error_on_disconnect.test.lua
+++ b/test/replication/show_error_on_disconnect.test.lua
@@ -8,7 +8,7 @@ SERVERS = {'show_error_on_disconnect1', 'show_error_on_disconnect2'}
 
 -- Deploy a cluster.
 test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-test_run:wait_fullmesh(SERVERS)
+while test_run:wait_fullmesh(SERVERS) ~= true do test_run:recreate_cluster(SERVERS, "replication", {args="0.1"}) end
 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