Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] test: wait for log entry
@ 2018-12-18  8:39 Sergei Voronezhskii
  2018-12-23  9:41 ` Alexander Turenko
  2018-12-24 11:55 ` Vladimir Davydov
  0 siblings, 2 replies; 3+ messages in thread
From: Sergei Voronezhskii @ 2018-12-18  8:39 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Alexander Turenko, Kirill Yukhin

replication/sync.result fails on `test_run:grep_log('replica', 'ER_CFG`
which returns null, which means this entry is not found, instead
wait_log 10s to be sure that the entry appeared in the log

Fixes: #3835
---
BRANCH: https://github.com/tarantool/tarantool/tree/sergw/fix-replication-sync-grep-log
 test/replication/sync.result   | 2 +-
 test/replication/sync.test.lua | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/replication/sync.result b/test/replication/sync.result
index b34501dae..c0990ca6d 100644
--- a/test/replication/sync.result
+++ b/test/replication/sync.result
@@ -298,7 +298,7 @@ box.info.replication[1].upstream.status -- follow
 ---
 - follow
 ...
-test_run:grep_log('replica', 'ER_CFG.*')
+test_run:wait_log('replica', 'ER_CFG.*', nil, 10)
 ---
 - 'ER_CFG: Incorrect value for option ''replication'': duplicate connection with the
   same replica UUID'
diff --git a/test/replication/sync.test.lua b/test/replication/sync.test.lua
index cae97a26f..80327b061 100644
--- a/test/replication/sync.test.lua
+++ b/test/replication/sync.test.lua
@@ -154,7 +154,7 @@ box.cfg{replication = replication}
 box.info.status -- running
 box.info.ro -- false
 box.info.replication[1].upstream.status -- follow
-test_run:grep_log('replica', 'ER_CFG.*')
+test_run:wait_log('replica', 'ER_CFG.*', nil, 10)
 
 test_run:cmd("switch default")
 test_run:cmd("stop server replica")
-- 
2.18.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] [PATCH] test: wait for log entry
  2018-12-18  8:39 [tarantool-patches] [PATCH] test: wait for log entry Sergei Voronezhskii
@ 2018-12-23  9:41 ` Alexander Turenko
  2018-12-24 11:55 ` Vladimir Davydov
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Turenko @ 2018-12-23  9:41 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: Sergei Voronezhskii, Kirill Yukhin, tarantool-patches

Vladimir, can you please look into this patch?

Sergei, please use git blame to determine author of a test case and ask
the author for review.

WBR, Alexander Turenko.

On Tue, Dec 18, 2018 at 11:39:37AM +0300, Sergei Voronezhskii wrote:
> replication/sync.result fails on `test_run:grep_log('replica', 'ER_CFG`

.result -> .test.lua

> which returns null, which means this entry is not found, instead
> wait_log 10s to be sure that the entry appeared in the log
> 
> Fixes: #3835
> ---
> BRANCH: https://github.com/tarantool/tarantool/tree/sergw/fix-replication-sync-grep-log
>  test/replication/sync.result   | 2 +-
>  test/replication/sync.test.lua | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/test/replication/sync.result b/test/replication/sync.result
> index b34501dae..c0990ca6d 100644
> --- a/test/replication/sync.result
> +++ b/test/replication/sync.result
> @@ -298,7 +298,7 @@ box.info.replication[1].upstream.status -- follow
>  ---
>  - follow
>  ...
> -test_run:grep_log('replica', 'ER_CFG.*')
> +test_run:wait_log('replica', 'ER_CFG.*', nil, 10)
>  ---
>  - 'ER_CFG: Incorrect value for option ''replication'': duplicate connection with the
>    same replica UUID'
> diff --git a/test/replication/sync.test.lua b/test/replication/sync.test.lua
> index cae97a26f..80327b061 100644
> --- a/test/replication/sync.test.lua
> +++ b/test/replication/sync.test.lua
> @@ -154,7 +154,7 @@ box.cfg{replication = replication}
>  box.info.status -- running
>  box.info.ro -- false
>  box.info.replication[1].upstream.status -- follow
> -test_run:grep_log('replica', 'ER_CFG.*')
> +test_run:wait_log('replica', 'ER_CFG.*', nil, 10)
>  
>  test_run:cmd("switch default")
>  test_run:cmd("stop server replica")
> -- 
> 2.18.0
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] [PATCH] test: wait for log entry
  2018-12-18  8:39 [tarantool-patches] [PATCH] test: wait for log entry Sergei Voronezhskii
  2018-12-23  9:41 ` Alexander Turenko
@ 2018-12-24 11:55 ` Vladimir Davydov
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Davydov @ 2018-12-24 11:55 UTC (permalink / raw)
  To: Sergei Voronezhskii; +Cc: tarantool-patches, Alexander Turenko, Kirill Yukhin

On Tue, Dec 18, 2018 at 11:39:37AM +0300, Sergei Voronezhskii wrote:
> replication/sync.result fails on `test_run:grep_log('replica', 'ER_CFG`
> which returns null, which means this entry is not found, instead
> wait_log 10s to be sure that the entry appeared in the log
> 
> Fixes: #3835

The issue title/description says nothing about this particular failure.
Please update.

> ---
> BRANCH: https://github.com/tarantool/tarantool/tree/sergw/fix-replication-sync-grep-log

Link to the issue is missing. BRANCH prefix is redundant.

>  test/replication/sync.result   | 2 +-
>  test/replication/sync.test.lua | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/test/replication/sync.result b/test/replication/sync.result
> index b34501dae..c0990ca6d 100644
> --- a/test/replication/sync.result
> +++ b/test/replication/sync.result
> @@ -298,7 +298,7 @@ box.info.replication[1].upstream.status -- follow
>  ---
>  - follow
>  ...
> -test_run:grep_log('replica', 'ER_CFG.*')
> +test_run:wait_log('replica', 'ER_CFG.*', nil, 10)

This is wrong - by the time box.cfg() returns, the error message must
have already been printed to the log. Instead the test should wait for
the message to appear in the log before disabling WAL_DELAY injection.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-24 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18  8:39 [tarantool-patches] [PATCH] test: wait for log entry Sergei Voronezhskii
2018-12-23  9:41 ` Alexander Turenko
2018-12-24 11:55 ` Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox