Tarantool development patches archive
 help / color / mirror / Atom feed
From: Yaroslav Dynnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: Yaroslav Dynnikov <yaroslav.dynnikov@tarantool.org>,
	tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 1/2] test: fix test output on latest Tarantool
Date: Thu, 20 May 2021 00:50:49 +0300	[thread overview]
Message-ID: <CAK0MaD3PofRc5-gA2q_B8QmNNpfQcj8ZnwJK=tdjNXy9c-BQPw@mail.gmail.com> (raw)
In-Reply-To: <b580c9081e63a83d39adfabac17b5052de549292.1620903962.git.v.shpilevoy@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 1954 bytes --]

HI, Vlad

Thanks for the patch.
Find one comment below.

On Thu, 13 May 2021 at 14:07, Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
wrote:

> Duplicate key error at insertion into a space on the latest
> Tarantool changed its message and it broke of the tests. The patch
> updates the test so it checks only the needed part of the message
> and does not depend on Tarantool version anymore.
> ---
>  test/storage/storage.result   | 8 +++++---
>  test/storage/storage.test.lua | 3 ++-
>  2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/test/storage/storage.result b/test/storage/storage.result
> index 2c9784a..d18b7f8 100644
> --- a/test/storage/storage.result
> +++ b/test/storage/storage.result
> @@ -179,10 +179,12 @@ vshard.storage.buckets_info()
>      status: active
>      id: 1
>  ...
> -vshard.storage.bucket_force_create(1) -- error
> +ok, err = vshard.storage.bucket_force_create(1)
>  ---
> -- null
> -- Duplicate key exists in unique index 'pk' in space '_bucket'
> +...
> +assert(not ok and err.message:match("Duplicate key exists"))
> +---
> +- Duplicate key exists
>  ...
>  vshard.storage.bucket_force_drop(1)
>  ---
> diff --git a/test/storage/storage.test.lua b/test/storage/storage.test.lua
> index 33f0498..97558f6 100644
> --- a/test/storage/storage.test.lua
> +++ b/test/storage/storage.test.lua
> @@ -56,7 +56,8 @@ vshard.storage.sync(100500)
>  vshard.storage.buckets_info()
>  vshard.storage.bucket_force_create(1)
>  vshard.storage.buckets_info()
> -vshard.storage.bucket_force_create(1) -- error
> +ok, err = vshard.storage.bucket_force_create(1)
> +assert(not ok and "err.message:match("Duplicate key exists))
>

I'd suggest splitting the check in two:

1. ok -- should be false
2. Then check the message matches.

Assertions usually don't provide useful errors.


>  vshard.storage.bucket_force_drop(1)
>
>  vshard.storage.buckets_info()
> --
> 2.24.3 (Apple Git-128)
>
>
Best regards
Yaroslav Dynnikov

[-- Attachment #2: Type: text/html, Size: 3099 bytes --]

  parent reply	other threads:[~2021-05-19 21:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 11:07 [Tarantool-patches] [PATCH 0/2] vshard.storage.buckets_count() bug Vladislav Shpilevoy via Tarantool-patches
2021-05-13 11:07 ` [Tarantool-patches] [PATCH 1/2] test: fix test output on latest Tarantool Vladislav Shpilevoy via Tarantool-patches
2021-05-13 20:23   ` Oleg Babin via Tarantool-patches
2021-05-19 21:50   ` Yaroslav Dynnikov via Tarantool-patches [this message]
2021-05-21 19:26     ` Vladislav Shpilevoy via Tarantool-patches
2021-05-21 21:54       ` Yaroslav Dynnikov via Tarantool-patches
2021-05-13 11:07 ` [Tarantool-patches] [PATCH 2/2] vshard: fix buckets_count() on replicas Vladislav Shpilevoy via Tarantool-patches
2021-05-13 20:23   ` Oleg Babin via Tarantool-patches
2021-05-21 19:26     ` Vladislav Shpilevoy via Tarantool-patches
2021-05-24  6:57       ` Oleg Babin via Tarantool-patches
2021-05-19 21:51   ` Yaroslav Dynnikov via Tarantool-patches
2021-05-21 19:30     ` Vladislav Shpilevoy via Tarantool-patches
2021-05-13 20:23 ` [Tarantool-patches] [PATCH 0/2] vshard.storage.buckets_count() bug Oleg Babin via Tarantool-patches
2021-05-25 20:43 ` Vladislav Shpilevoy via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK0MaD3PofRc5-gA2q_B8QmNNpfQcj8ZnwJK=tdjNXy9c-BQPw@mail.gmail.com' \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --cc=yaroslav.dynnikov@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] test: fix test output on latest Tarantool' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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