From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 425AD6C1AE; Thu, 20 May 2021 00:51:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 425AD6C1AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1621461064; bh=WDrPIlxZrvp2dLPS6IrK+oXNGfTcD923QWzvWooMZRk=; h=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=KQXjQd5SYNW2z4sO0Z7rt4wpx6hDPm+NeYQZGnyUacZs0GVk2ujnJcF3M2VhHihnp 9ZLNowNqFpVHXdiHa1irhN89PY0JRfQKqWnFBKKv6AV8mYz7LJMnFRsITikfnosOwG v0ugvW1UqWx5GdomPZszxm9Vq8C0/xBYFgZBmgms= Received: from smtp30.i.mail.ru (smtp30.i.mail.ru [94.100.177.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 503AA6C1AE for ; Thu, 20 May 2021 00:51:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 503AA6C1AE Received: by smtp30.i.mail.ru with esmtpa (envelope-from ) id 1ljU5l-00088q-O9 for tarantool-patches@dev.tarantool.org; Thu, 20 May 2021 00:51:02 +0300 Received: by mail-lj1-f174.google.com with SMTP id e11so17269917ljn.13 for ; Wed, 19 May 2021 14:51:01 -0700 (PDT) X-Gm-Message-State: AOAM531O5us8L5RqUZWIWzaSO4TH9HEBI8/vWXrdzIyY+ROOBjZlMhms 4t7Inij/EtsE0UZxRJFTdLrFS7Jy0ehNozjMvw== X-Google-Smtp-Source: ABdhPJydEtdADqsj6KFtxn4svLp3gjyqsbH+rIOJsK9wcZKmY/dhIu0NAN0dLnJfTzwsBIOp8uM9JMbbp0aG7uQvT/8= X-Received: by 2002:a2e:9947:: with SMTP id r7mr812206ljj.263.1621461061336; Wed, 19 May 2021 14:51:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 20 May 2021 00:50:49 +0300 X-Gmail-Original-Message-ID: Message-ID: To: Vladislav Shpilevoy Content-Type: multipart/alternative; boundary="00000000000094023e05c2b5d29e" X-4EC0790: 1 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91B019B01C53E51AF6F63A46F26EE68FD6CF19A7203B0589400894C459B0CD1B995B020A37BA270EE24C3C56B3152581379D594B285AE74F1DF792DC1A657B3D2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D9C4478D0B876341EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637802D3462438662818638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D842A034F8A0A5B26FC4866E3484851CCE117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EECCD848CCB6FE560C6E0066C2D8992A164AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C3F66EC77D7E06B9B6BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE73EC5E744BD5384AD731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4ADFC896A72DD5706E68159C8B4EC239C1F X-C1DE0DAB: 0D63561A33F958A5A32563BD68E0C62140F775E4D6ADA35A9CA589FEFE62D141D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3447DF5779098ECEE9C7D1242ACD2450D2D181A84A8E86EF3D4CA27D3CEC0E4F821ECC2B2E12052E531D7E09C32AA3244C941B3F72D1CA595580AF1712AF835AEA5595C85A795C7BAE3EB3F6AD6EA9203E X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojF35yOkZDoIVHic1/c4H84w== X-Mailru-Sender: 4C235FE2E5D2D89003AD55F913C7BF9ED1028FAF45CE841CD7937784757F1B95EC898040696C8C5A7B6BBE17E403543AD070B20000CAF116B128302DCECB6B19FE2C68CC745D971B112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/2] test: fix test output on latest Tarantool X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Yaroslav Dynnikov via Tarantool-patches Reply-To: Yaroslav Dynnikov Cc: Yaroslav Dynnikov , tml Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" --00000000000094023e05c2b5d29e Content-Type: text/plain; charset="UTF-8" HI, Vlad Thanks for the patch. Find one comment below. On Thu, 13 May 2021 at 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)) > 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 --00000000000094023e05c2b5d29e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
HI, Vlad

Thanks for the patch.
Find one comment below.

=
On T= hu, 13 May 2021 at 14:07, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wro= te:
Duplicate ke= y 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.
---
=C2=A0test/storage/storage.result=C2=A0 =C2=A0| 8 +++++---
=C2=A0test/storage/storage.test.lua | 3 ++-
=C2=A02 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()
=C2=A0 =C2=A0 =C2=A0status: active
=C2=A0 =C2=A0 =C2=A0id: 1
=C2=A0...
-vshard.storage.bucket_force_create(1) -- error
+ok, err =3D vshard.storage.bucket_force_create(1)
=C2=A0---
-- null
-- Duplicate key exists in unique index 'pk' in space '_bucket&= #39;
+...
+assert(not ok and err.message:match("Duplicate key exists"))
+---
+- Duplicate key exists
=C2=A0...
=C2=A0vshard.storage.bucket_force_drop(1)
=C2=A0---
diff --git a/test/storage/storage.test.lua b/test/storage/storage.test.lua<= br> index 33f0498..97558f6 100644
--- a/test/storage/storage.test.lua
+++ b/test/storage/storage.test.lua
@@ -56,7 +56,8 @@ vshard.storage.sync(100500)
=C2=A0vshard.storage.buckets_info()
=C2=A0vshard.storage.bucket_force_create(1)
=C2=A0vshard.storage.buckets_info()
-vshard.storage.bucket_force_create(1) -- error
+ok, err =3D 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.
=C2=A0
=C2=A0vshard.storage.bucket_force_drop(1)

=C2=A0vshard.storage.buckets_info()
--
2.24.3 (Apple Git-128)


Best regards
<= div>Yaroslav Dynnikov


=C2=A0
--00000000000094023e05c2b5d29e--