[Tarantool-patches] [PATCH 1/2] test: fix test output on latest Tarantool

Oleg Babin olegrok at tarantool.org
Thu May 13 23:23:20 MSK 2021


Hi! Thanks for your patch. LGTM.

On 13.05.2021 14:07, Vladislav Shpilevoy 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"))
>   vshard.storage.bucket_force_drop(1)
>   
>   vshard.storage.buckets_info()


More information about the Tarantool-patches mailing list