<div dir="ltr"><div dir="ltr"><div>HI, Vlad<br></div></div><div><br></div><div>Thanks for the patch.<br></div><div>Find one comment below.<br></div><div dir="ltr"><div><div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><span><br></span></div></div></div></div></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 13 May 2021 at 14:07, Vladislav Shpilevoy <<a href="mailto:v.shpilevoy@tarantool.org" target="_blank">v.shpilevoy@tarantool.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Duplicate key error at insertion into a space on the latest<br>
Tarantool changed its message and it broke of the tests. The patch<br>
updates the test so it checks only the needed part of the message<br>
and does not depend on Tarantool version anymore.<br>
---<br>
 test/storage/storage.result   | 8 +++++---<br>
 test/storage/storage.test.lua | 3 ++-<br>
 2 files changed, 7 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/test/storage/storage.result b/test/storage/storage.result<br>
index 2c9784a..d18b7f8 100644<br>
--- a/test/storage/storage.result<br>
+++ b/test/storage/storage.result<br>
@@ -179,10 +179,12 @@ vshard.storage.buckets_info()<br>
     status: active<br>
     id: 1<br>
 ...<br>
-vshard.storage.bucket_force_create(1) -- error<br>
+ok, err = vshard.storage.bucket_force_create(1)<br>
 ---<br>
-- null<br>
-- Duplicate key exists in unique index 'pk' in space '_bucket'<br>
+...<br>
+assert(not ok and err.message:match("Duplicate key exists"))<br>
+---<br>
+- Duplicate key exists<br>
 ...<br>
 vshard.storage.bucket_force_drop(1)<br>
 ---<br>
diff --git a/test/storage/storage.test.lua b/test/storage/storage.test.lua<br>
index 33f0498..97558f6 100644<br>
--- a/test/storage/storage.test.lua<br>
+++ b/test/storage/storage.test.lua<br>
@@ -56,7 +56,8 @@ vshard.storage.sync(100500)<br>
 vshard.storage.buckets_info()<br>
 vshard.storage.bucket_force_create(1)<br>
 vshard.storage.buckets_info()<br>
-vshard.storage.bucket_force_create(1) -- error<br>
+ok, err = vshard.storage.bucket_force_create(1)<br>
+assert(not ok and "err.message:match("Duplicate key exists))<br></blockquote><div><br></div><div>I'd suggest splitting the check in two:</div><div><br></div><div>1. ok -- should be false</div><div>2. Then check the message matches.</div><div><br></div><div>Assertions usually don't provide useful errors.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 vshard.storage.bucket_force_drop(1)<br>
<br>
 vshard.storage.buckets_info()<br>
-- <br>
2.24.3 (Apple Git-128)<br>
<br></blockquote><div><br></div><div><div dir="ltr"><div><div><div><div dir="ltr"><div dir="ltr"><span><div><div dir="ltr">Best regards</div><div>Yaroslav Dynnikov<br></div></div></span></div></div></div><br><br></div></div></div> </div></div>
</div>