[patches] [PATCH 2/2] netbox: do not clog log with repeating reconnect error messages
v.shpilevoy at tarantool.org
v.shpilevoy at tarantool.org
Mon Mar 5 22:01:53 MSK 2018
Removed the test case about repeating error messages for @kostja.
diff --git a/test/box/net.box.result b/test/box/net.box.result
index 898bc8087..62581a5cf 100644
--- a/test/box/net.box.result
+++ b/test/box/net.box.result
@@ -2218,9 +2218,6 @@ weak.c:ping()
---
- true
...
-log.info(string.rep('a', 1000))
----
-...
test_run:cmd('stop server connecter')
---
- true
@@ -2229,31 +2226,16 @@ test_run:cmd('cleanup server connecter')
---
- true
...
--- For gh-3175 check that reconnect error messages are not
--- repeated. At first, wait the first error message.
-while test_run:grep_log('default', 'Connection refused', 1000) == nil do fiber.sleep(0.1) end
----
-...
-log.info(string.rep('a', 1000))
----
-...
--- Wait next reconnect attempt.
-fiber.sleep(0.6)
----
-...
--- The log must not contain the same error message.
-test_run:grep_log('default', 'Connection refused', 1000)
----
-- null
-...
--- Switch to verbose log level to see repeating error messages.
+-- Check the connection tries to reconnect at least two times.
old_log_level = box.cfg.log_level
---
...
box.cfg{log_level = 6}
---
...
--- Check the connection tries to reconnect at least two times.
+log.info(string.rep('a', 1000))
+---
+...
while test_run:grep_log('default', 'Connection refused', 1000) == nil do fiber.sleep(0.1) end
---
...
diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
index b8cc90935..d7ebda00e 100644
--- a/test/box/net.box.test.lua
+++ b/test/box/net.box.test.lua
@@ -905,21 +905,12 @@ weak = setmetatable({}, {__mode = 'v'})
strong = net.connect(connect_to, {reconnect_after = 0.1})
weak.c = strong
weak.c:ping()
-log.info(string.rep('a', 1000))
test_run:cmd('stop server connecter')
test_run:cmd('cleanup server connecter')
--- For gh-3175 check that reconnect error messages are not
--- repeated. At first, wait the first error message.
-while test_run:grep_log('default', 'Connection refused', 1000) == nil do fiber.sleep(0.1) end
-log.info(string.rep('a', 1000))
--- Wait next reconnect attempt.
-fiber.sleep(0.6)
--- The log must not contain the same error message.
-test_run:grep_log('default', 'Connection refused', 1000)
--- Switch to verbose log level to see repeating error messages.
+-- Check the connection tries to reconnect at least two times.
old_log_level = box.cfg.log_level
box.cfg{log_level = 6}
--- Check the connection tries to reconnect at least two times.
+log.info(string.rep('a', 1000))
while test_run:grep_log('default', 'Connection refused', 1000) == nil do fiber.sleep(0.1) end
log.info(string.rep('a', 1000))
while test_run:grep_log('default', 'Connection refused', 1000) == nil do fiber.sleep(0.1) end
More information about the Tarantool-patches
mailing list