[Tarantool-patches] [PATCH v1] test: fix replication/skip_conflict_row output

Oleg Koshovetc okoshovetc at tarantool.org
Wed Dec 9 13:24:40 MSK 2020


LGTM

On 09.12.2020 10:04, Alexander V. Tikhonov wrote:
> Cc: tarantool-patches at dev.tarantool.org
>
> Found that test replication/skip_conflict_row.test.lua fails with
> output message in results file:
>
>    [260] @@ -117,11 +117,23 @@
>    [260]  -- lsn is not promoted
>    [260]  lsn1 == box.info.vclock[1]
>    [260]  ---
>    [260] -- true
>    [260] +- false
>    [260]  ...
>    [260]  test_run:wait_upstream(1, {status = 'stopped', message_re = "Duplicate key exists in unique index 'primary' in space 'test'"})
>    [260]  ---
>    [260] -- true
>    [260] +- false
>    [260] +- id: 1
>    [260] +  uuid: bdbf6673-6ee4-47eb-a88d-81164f4e61c9
>
> Test could not be restarted with checksum because of changing values
> like UUID on each fail. It happend because test-run uses internal
> chain of functions wait_upstream() -> gen_box_info_replication_cond()
> which returns instance information on its fails. To avoid of it this
> output was redirected to log file instead of results file.
> ---
>
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/test-fix-skip-conflict
>
>   test/replication/skip_conflict_row.result   | 7 ++++++-
>   test/replication/skip_conflict_row.test.lua | 6 +++++-
>   test/replication/suite.ini                  | 3 ++-
>   3 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/test/replication/skip_conflict_row.result b/test/replication/skip_conflict_row.result
> index 737522b8b..df209f029 100644
> --- a/test/replication/skip_conflict_row.result
> +++ b/test/replication/skip_conflict_row.result
> @@ -119,7 +119,12 @@ lsn1 == box.info.vclock[1]
>   ---
>   - true
>   ...
> -test_run:wait_upstream(1, {status = 'stopped', message_re = "Duplicate key exists in unique index 'primary' in space 'test'"})
> +ok, instance_info = test_run:wait_upstream(1, {status = 'stopped', \
> +    message_re = "Duplicate key exists in unique index 'primary' in space 'test'"})
> +---
> +...
> +ok or require('log').error('test_run:wait_upstream failed with instance info: ' \
> +    .. require('json').encode(instance_info))
>   ---
>   - true
>   ...
> diff --git a/test/replication/skip_conflict_row.test.lua b/test/replication/skip_conflict_row.test.lua
> index e7a93cc74..32d473b66 100644
> --- a/test/replication/skip_conflict_row.test.lua
> +++ b/test/replication/skip_conflict_row.test.lua
> @@ -32,6 +32,7 @@ box.info.status
>   -- is not advanced on errors.
>   test_run:cmd("restart server replica")
>   test_run:cmd("switch replica")
> +
>   box.space.test:insert{3}
>   lsn1 = box.info.vclock[1]
>   test_run:cmd("switch default")
> @@ -40,7 +41,10 @@ box.space.test:insert{4}
>   test_run:cmd("switch replica")
>   -- lsn is not promoted
>   lsn1 == box.info.vclock[1]
> -test_run:wait_upstream(1, {status = 'stopped', message_re = "Duplicate key exists in unique index 'primary' in space 'test'"})
> +ok, instance_info = test_run:wait_upstream(1, {status = 'stopped', \
> +    message_re = "Duplicate key exists in unique index 'primary' in space 'test'"})
> +ok or require('log').error('test_run:wait_upstream failed with instance info: ' \
> +    .. require('json').encode(instance_info))
>   test_run:cmd("switch default")
>   test_run:cmd("restart server replica")
>   -- applier is not in follow state
> diff --git a/test/replication/suite.ini b/test/replication/suite.ini
> index 6c9eccb7a..ea12c545c 100644
> --- a/test/replication/suite.ini
> +++ b/test/replication/suite.ini
> @@ -27,7 +27,8 @@ fragile = {
>               "checksums": [ "945521821b8199c59716e969d89d953d", "b4e60f8ec2d4340bc0324f73e2cc8a01", "c7054aec18a7a983c717f1b92dd1434c", "09500c4d118ace1e05b23665ba055bf5" ]
>           },
>           "skip_conflict_row.test.lua": {
> -            "issues": [ "gh-4958" ]
> +            "issues": [ "gh-4958" ],
> +            "checksums": [ "c7f20590643ed9e0263d1f5784d65c2e" ]
>           },
>           "sync.test.lua": {
>               "issues": [ "gh-3835" ],


More information about the Tarantool-patches mailing list