[Tarantool-patches] [PATCH v1] test: move error messages for tests into logs (2)
Alexander V. Tikhonov
avtikhon at tarantool.org
Tue Sep 29 16:49:51 MSK 2020
Set error message to log output in test:
replication/replica_rejoin.test.lua gh-4985
---
Github: https://github.com/tarantool/tarantool/tree/avtikhon/flaky-checksums
test/replication/replica_rejoin.result | 11 +++++++----
test/replication/replica_rejoin.test.lua | 9 +++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/test/replication/replica_rejoin.result b/test/replication/replica_rejoin.result
index 4d9e83868..dbcde0db2 100644
--- a/test/replication/replica_rejoin.result
+++ b/test/replication/replica_rejoin.result
@@ -4,6 +4,9 @@ env = require('test_run')
test_run = env.new()
---
...
+log = require('log')
+---
+...
engine = test_run:get_cfg('engine')
---
...
@@ -45,7 +48,7 @@ test_run:cmd("switch replica")
---
- true
...
-box.info.replication[1].upstream.status == 'follow' or box.info
+box.info.replication[1].upstream.status == 'follow' or log(box.info)
---
- true
...
@@ -115,7 +118,7 @@ test_run:cmd("start server replica with args='true'")
---
- true
...
-box.info.replication[2].downstream.vclock ~= nil or box.info
+box.info.replication[2].downstream.vclock ~= nil or log(box.info)
---
- true
...
@@ -123,7 +126,7 @@ test_run:cmd("switch replica")
---
- true
...
-box.info.replication[1].upstream.status == 'follow' or box.info
+box.info.replication[1].upstream.status == 'follow' or log(box.info)
---
- true
...
@@ -162,7 +165,7 @@ box.space.test:select()
...
-- Check that restart works as usual.
test_run:cmd("restart server replica with args='true'")
-box.info.replication[1].upstream.status == 'follow' or box.info
+box.info.replication[1].upstream.status == 'follow' or log(box.info)
---
- true
...
diff --git a/test/replication/replica_rejoin.test.lua b/test/replication/replica_rejoin.test.lua
index 599a52988..3ea588aa6 100644
--- a/test/replication/replica_rejoin.test.lua
+++ b/test/replication/replica_rejoin.test.lua
@@ -1,5 +1,6 @@
env = require('test_run')
test_run = env.new()
+log = require('log')
engine = test_run:get_cfg('engine')
test_run:cleanup_cluster()
@@ -19,7 +20,7 @@ _ = box.space.test:insert{3}
test_run:cmd("create server replica with rpl_master=default, script='replication/replica.lua'")
test_run:cmd("start server replica with args='true'")
test_run:cmd("switch replica")
-box.info.replication[1].upstream.status == 'follow' or box.info
+box.info.replication[1].upstream.status == 'follow' or log(box.info)
box.space.test:select()
test_run:cmd("switch default")
test_run:cmd("stop server replica")
@@ -46,9 +47,9 @@ box.cfg{checkpoint_count = checkpoint_count}
-- Restart the replica. Since xlogs have been removed,
-- it is supposed to rejoin without changing id.
test_run:cmd("start server replica with args='true'")
-box.info.replication[2].downstream.vclock ~= nil or box.info
+box.info.replication[2].downstream.vclock ~= nil or log(box.info)
test_run:cmd("switch replica")
-box.info.replication[1].upstream.status == 'follow' or box.info
+box.info.replication[1].upstream.status == 'follow' or log(box.info)
box.space.test:select()
test_run:cmd("switch default")
@@ -62,7 +63,7 @@ box.space.test:select()
-- Check that restart works as usual.
test_run:cmd("restart server replica with args='true'")
-box.info.replication[1].upstream.status == 'follow' or box.info
+box.info.replication[1].upstream.status == 'follow' or log(box.info)
box.space.test:select()
-- Check that rebootstrap is NOT initiated unless the replica
--
2.25.1
More information about the Tarantool-patches
mailing list