Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org, olegrok@tarantool.org
Subject: [Tarantool-patches] [PATCH vshard 2/2] test: drop error codes from test output
Date: Wed, 29 Sep 2021 01:08:57 +0200	[thread overview]
Message-ID: <38d1fce83b3b4494f10e71facf7619b31cd58662.1632870481.git.v.shpilevoy@tarantool.org> (raw)
In-Reply-To: <cover.1632870481.git.v.shpilevoy@tarantool.org>

In the newest Tarantool the error objects are encoded as MP_ERROR
in netbox connections by default. This allows to transfer their
full data including correct error code, even when returned as
nil,err instead of throwing the error as an exception.

Because of that some vshard tests failed - they expected the error
codes returned from the server to be wrong.

On the other hand, the codes can't be fixed, because then the
tests wouldn't work on 1.10.

The patch just drops the codes. At least while need to support
Tarantool versions not using MP_ERROR in netbox by default.
---
 test/lua_libs/util.lua                  | 2 +-
 test/misc/check_uuid_on_connect.result  | 2 --
 test/rebalancer/bucket_ref.result       | 1 -
 test/rebalancer/receiving_bucket.result | 3 ---
 test/router/retry_reads.result          | 2 --
 test/router/router.result               | 3 ---
 test/router/sync.result                 | 2 --
 test/storage/storage.result             | 1 -
 test/unit/error.result                  | 2 --
 9 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/test/lua_libs/util.lua b/test/lua_libs/util.lua
index 9c2e667..fe23065 100644
--- a/test/lua_libs/util.lua
+++ b/test/lua_libs/util.lua
@@ -198,7 +198,7 @@ end
 -- trimmed in order for the tests not to depend on line numbers of
 -- the source files, which may slip into a .result file.
 local function portable_error(err)
-    return {code = err.code, type = err.type, message = err.message}
+    return {type = err.type, message = err.message}
 end
 
 return {
diff --git a/test/misc/check_uuid_on_connect.result b/test/misc/check_uuid_on_connect.result
index 6ebc5d0..8862e62 100644
--- a/test/misc/check_uuid_on_connect.result
+++ b/test/misc/check_uuid_on_connect.result
@@ -45,7 +45,6 @@ res, util.portable_error(err)
 ---
 - null
 - type: ClientError
-  code: 77
   message: Connection closed
 ...
 test_run:grep_log('bad_uuid_1_a', 'Mismatch server UUID on replica bad_uuid_2_a%(storage%@')
@@ -174,7 +173,6 @@ res, util.portable_error(err)
 ---
 - null
 - type: ClientError
-  code: 77
   message: Connection closed
 ...
 -- Close existing connection on a first error and log it.
diff --git a/test/rebalancer/bucket_ref.result b/test/rebalancer/bucket_ref.result
index 9df7480..67ae5bc 100644
--- a/test/rebalancer/bucket_ref.result
+++ b/test/rebalancer/bucket_ref.result
@@ -144,7 +144,6 @@ res, util.portable_error(err)
 ---
 - null
 - type: ClientError
-  code: 32
   message: Timeout exceeded
 ...
 vshard.storage.buckets_info(1)
diff --git a/test/rebalancer/receiving_bucket.result b/test/rebalancer/receiving_bucket.result
index ad93445..ae1da58 100644
--- a/test/rebalancer/receiving_bucket.result
+++ b/test/rebalancer/receiving_bucket.result
@@ -167,7 +167,6 @@ res, util.portable_error(err)
 ---
 - null
 - type: ClientError
-  code: 32
   message: Error injection 'the bucket is received partially'
 ...
 box.space._bucket:get{1}
@@ -225,7 +224,6 @@ _, err = vshard.storage.bucket_send(101, util.replicasets[1], {timeout = 0.1})
 util.portable_error(err)
 ---
 - type: ClientError
-  code: 78
   message: Timeout exceeded
 ...
 box.space._bucket:get{101}
@@ -332,7 +330,6 @@ ret, util.portable_error(err)
 ---
 - null
 - type: ClientError
-  code: 78
   message: Timeout exceeded
 ...
 finish_long_thing = true
diff --git a/test/router/retry_reads.result b/test/router/retry_reads.result
index fa38541..e5e721a 100644
--- a/test/router/retry_reads.result
+++ b/test/router/retry_reads.result
@@ -118,7 +118,6 @@ fiber.time() - start < 1
 util.portable_error(e)
 ---
 - type: ClientError
-  code: 0
   message: Unknown error
 ...
 _, e = rs1:callro('sleep', {1}, {timeout = 0.0001})
@@ -127,7 +126,6 @@ _, e = rs1:callro('sleep', {1}, {timeout = 0.0001})
 util.portable_error(e)
 ---
 - type: ClientError
-  code: 78
   message: Timeout exceeded
 ...
 --
diff --git a/test/router/router.result b/test/router/router.result
index 8ddbe6d..f9bf649 100644
--- a/test/router/router.result
+++ b/test/router/router.result
@@ -259,7 +259,6 @@ _, e = vshard.router.callro(1, 'raise_client_error', {}, {})
 util.portable_error(e)
 ---
 - type: ClientError
-  code: 32
   message: Unknown error
 ...
 _, e = vshard.router.route(1):callro('raise_client_error', {})
@@ -268,7 +267,6 @@ _, e = vshard.router.route(1):callro('raise_client_error', {})
 util.portable_error(e)
 ---
 - type: ClientError
-  code: 0
   message: Unknown error
 ...
 -- Ensure, that despite not working multi-return, it is allowed
@@ -640,7 +638,6 @@ assert(type(err) == 'table')
 util.portable_error(err)
 ---
 - type: ClientError
-  code: 32
   message: Unknown error
 ...
 future:is_ready()
diff --git a/test/router/sync.result b/test/router/sync.result
index 040d611..164861e 100644
--- a/test/router/sync.result
+++ b/test/router/sync.result
@@ -51,7 +51,6 @@ res, err = vshard.router.sync(-1)
 util.portable_error(err)
 ---
 - type: ClientError
-  code: 78
   message: Timeout exceeded
 ...
 res, err = vshard.router.sync(0)
@@ -60,7 +59,6 @@ res, err = vshard.router.sync(0)
 util.portable_error(err)
 ---
 - type: ClientError
-  code: 78
   message: Timeout exceeded
 ...
 --
diff --git a/test/storage/storage.result b/test/storage/storage.result
index acae98f..af48a13 100644
--- a/test/storage/storage.result
+++ b/test/storage/storage.result
@@ -514,7 +514,6 @@ res, err = vshard.storage.bucket_recv(4, util.replicasets[2], {{1000, {{1}}}})
 util.portable_error(err)
 ---
 - type: ClientError
-  code: 36
   message: Space '1000' does not exist
 ...
 while box.space._bucket:get{4} do vshard.storage.recovery_wakeup() fiber.sleep(0.01) end
diff --git a/test/unit/error.result b/test/unit/error.result
index 738cfeb..bb4e0cc 100644
--- a/test/unit/error.result
+++ b/test/unit/error.result
@@ -28,7 +28,6 @@ str = tostring(box_error)
 util.portable_error(json.decode(str))
 ---
 - type: ClientError
-  code: 78
   message: Timeout exceeded
 ...
 vshard_error = lerror.vshard(lerror.code.UNREACHABLE_MASTER, 'uuid', 'reason')
@@ -94,7 +93,6 @@ err = lerror.make(err)
 util.portable_error(err)
 ---
 - type: ClientError
-  code: 32
   message: '[string "function raise_lua_err() assert(false) end "]:1: assertion failed!'
 ...
 --
-- 
2.24.3 (Apple Git-128)


  parent reply	other threads:[~2021-09-28 23:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 23:08 [Tarantool-patches] [PATCH vshard 0/2] VShard new netbox Vladislav Shpilevoy via Tarantool-patches
2021-09-28 23:08 ` [Tarantool-patches] [PATCH vshard 1/2] router: wrap is_async futures completely Vladislav Shpilevoy via Tarantool-patches
2021-09-29  6:18   ` Oleg Babin via Tarantool-patches
2021-09-30 22:39     ` Vladislav Shpilevoy via Tarantool-patches
2021-10-01  6:38       ` Oleg Babin via Tarantool-patches
2021-09-28 23:08 ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-09-29  6:18   ` [Tarantool-patches] [PATCH vshard 2/2] test: drop error codes from test output Oleg Babin via Tarantool-patches
2021-10-01 21:14 ` [Tarantool-patches] [PATCH vshard 0/2] VShard new netbox 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=38d1fce83b3b4494f10e71facf7619b31cd58662.1632870481.git.v.shpilevoy@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=olegrok@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH vshard 2/2] test: drop error codes from test output' \
    /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