From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: tarantool-patches@dev.tarantool.org, olegrok@tarantool.org, yaroslav.dynnikov@tarantool.org Subject: [Tarantool-patches] [PATCH vshard 2/6] test: sort some table prints Date: Fri, 2 Jul 2021 00:09:32 +0200 [thread overview] Message-ID: <b9aff3688d26d84c62c69ed561ccb05fdf505b86.1625177221.git.v.shpilevoy@tarantool.org> (raw) In-Reply-To: <cover.1625177221.git.v.shpilevoy@tarantool.org> Router.test.lua and upgrade.test.lua printed some Lua tables which were not sorted. Next patches are going to alter them slightly and if the tables are not sorted, some old keys would change place and increase the diff. The patch makes these outputs sorted so any amendment won't touch the existing lines. --- test/router/router.result | 28 +++++++++++++++++----------- test/router/router.test.lua | 2 ++ test/upgrade/upgrade.result | 14 +++++++------- vshard/storage/init.lua | 3 ++- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/test/router/router.result b/test/router/router.result index f9ee37c..98dd5b5 100644 --- a/test/router/router.result +++ b/test/router/router.result @@ -1158,21 +1158,24 @@ end; _ = test_run:cmd("setopt delimiter ''"); --- ... +table.sort(error_messages) +--- +... error_messages --- -- - Use replicaset:callro(...) instead of replicaset.callro(...) - - Use replicaset:connect_master(...) instead of replicaset.connect_master(...) +- - Use replicaset:call(...) instead of replicaset.call(...) + - Use replicaset:callbre(...) instead of replicaset.callbre(...) + - Use replicaset:callbro(...) instead of replicaset.callbro(...) - Use replicaset:callre(...) instead of replicaset.callre(...) - - Use replicaset:down_replica_priority(...) instead of replicaset.down_replica_priority(...) + - Use replicaset:callro(...) instead of replicaset.callro(...) + - Use replicaset:callrw(...) instead of replicaset.callrw(...) - Use replicaset:connect(...) instead of replicaset.connect(...) - - Use replicaset:wait_connected(...) instead of replicaset.wait_connected(...) - - Use replicaset:up_replica_priority(...) instead of replicaset.up_replica_priority(...) - - Use replicaset:callbro(...) instead of replicaset.callbro(...) - Use replicaset:connect_all(...) instead of replicaset.connect_all(...) + - Use replicaset:connect_master(...) instead of replicaset.connect_master(...) - Use replicaset:connect_replica(...) instead of replicaset.connect_replica(...) - - Use replicaset:call(...) instead of replicaset.call(...) - - Use replicaset:callrw(...) instead of replicaset.callrw(...) - - Use replicaset:callbre(...) instead of replicaset.callbre(...) + - Use replicaset:down_replica_priority(...) instead of replicaset.down_replica_priority(...) + - Use replicaset:up_replica_priority(...) instead of replicaset.up_replica_priority(...) + - Use replicaset:wait_connected(...) instead of replicaset.wait_connected(...) ... _, replica = next(replicaset.replicas) --- @@ -1192,11 +1195,14 @@ end; _ = test_run:cmd("setopt delimiter ''"); --- ... +table.sort(error_messages) +--- +... error_messages --- -- - Use replica:safe_uri(...) instead of replica.safe_uri(...) - - Use replica:detach_conn(...) instead of replica.detach_conn(...) +- - Use replica:detach_conn(...) instead of replica.detach_conn(...) - Use replica:is_connected(...) instead of replica.is_connected(...) + - Use replica:safe_uri(...) instead of replica.safe_uri(...) ... -- -- gh-117: Preserve route_map on router.cfg. diff --git a/test/router/router.test.lua b/test/router/router.test.lua index aa3eb3b..0017111 100644 --- a/test/router/router.test.lua +++ b/test/router/router.test.lua @@ -413,6 +413,7 @@ for _, func in pairs(getmetatable(replicaset).__index) do table.insert(error_messages, msg:match("Use .*")) end; _ = test_run:cmd("setopt delimiter ''"); +table.sort(error_messages) error_messages _, replica = next(replicaset.replicas) @@ -424,6 +425,7 @@ for _, func in pairs(getmetatable(replica).__index) do table.insert(error_messages, msg:match("Use .*")) end; _ = test_run:cmd("setopt delimiter ''"); +table.sort(error_messages) error_messages -- diff --git a/test/upgrade/upgrade.result b/test/upgrade/upgrade.result index 833da3f..8280e5b 100644 --- a/test/upgrade/upgrade.result +++ b/test/upgrade/upgrade.result @@ -161,13 +161,13 @@ vshard.storage._call ~= nil | ... vshard.storage._call('test_api', 1, 2, 3) | --- - | - bucket_recv: true - | storage_ref: true - | rebalancer_apply_routes: true - | storage_map: true - | rebalancer_request_state: true - | test_api: true - | storage_unref: true + | - - bucket_recv + | - rebalancer_apply_routes + | - rebalancer_request_state + | - storage_map + | - storage_ref + | - storage_unref + | - test_api | - 1 | - 2 | - 3 diff --git a/vshard/storage/init.lua b/vshard/storage/init.lua index 14ec42b..e13a24e 100644 --- a/vshard/storage/init.lua +++ b/vshard/storage/init.lua @@ -2566,8 +2566,9 @@ service_call_api = setmetatable({ }, {__serialize = function(api) local res = {} for k, _ in pairs(api) do - res[k] = true + table.insert(res, k) end + table.sort(res) return res end}) -- 2.24.3 (Apple Git-128)
next prev parent reply other threads:[~2021-07-01 22:10 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-01 22:09 [Tarantool-patches] [PATCH vshard 0/6] Master discovery Vladislav Shpilevoy via Tarantool-patches 2021-07-01 22:09 ` [Tarantool-patches] [PATCH vshard 1/6] replicaset: introduce netbox_wait_connected() Vladislav Shpilevoy via Tarantool-patches 2021-07-02 11:46 ` Oleg Babin via Tarantool-patches 2021-07-01 22:09 ` Vladislav Shpilevoy via Tarantool-patches [this message] 2021-07-02 11:46 ` [Tarantool-patches] [PATCH vshard 2/6] test: sort some table prints Oleg Babin via Tarantool-patches 2021-07-01 22:09 ` [Tarantool-patches] [PATCH vshard 3/6] storage: introduce vshard.storage._call('info') Vladislav Shpilevoy via Tarantool-patches 2021-07-02 11:46 ` Oleg Babin via Tarantool-patches 2021-07-01 22:09 ` [Tarantool-patches] [PATCH vshard 4/6] config: introduce master 'auto' replicaset option Vladislav Shpilevoy via Tarantool-patches 2021-07-02 11:47 ` Oleg Babin via Tarantool-patches 2021-07-02 21:32 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-05 9:23 ` Oleg Babin via Tarantool-patches 2021-07-01 22:09 ` [Tarantool-patches] [PATCH vshard 5/6] router: introduce automatic master discovery Vladislav Shpilevoy via Tarantool-patches 2021-07-02 11:48 ` Oleg Babin via Tarantool-patches 2021-07-02 21:35 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-05 9:24 ` Oleg Babin via Tarantool-patches 2021-07-05 20:53 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-06 8:54 ` Oleg Babin via Tarantool-patches 2021-07-06 21:19 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-01 22:09 ` [Tarantool-patches] [PATCH vshard 6/6] router: update master using a hint from storage Vladislav Shpilevoy via Tarantool-patches 2021-07-02 11:49 ` Oleg Babin via Tarantool-patches 2021-07-02 21:36 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-05 9:24 ` Oleg Babin via Tarantool-patches 2021-07-05 20:53 ` Vladislav Shpilevoy via Tarantool-patches 2021-07-06 8:55 ` Oleg Babin via Tarantool-patches 2021-07-02 21:36 ` [Tarantool-patches] [PATCH vshard 7/6] util: truncate too long fiber name Vladislav Shpilevoy via Tarantool-patches 2021-07-05 9:23 ` Oleg Babin via Tarantool-patches 2021-08-03 21:55 ` [Tarantool-patches] [PATCH vshard 0/6] Master discovery 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=b9aff3688d26d84c62c69ed561ccb05fdf505b86.1625177221.git.v.shpilevoy@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=olegrok@tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --cc=yaroslav.dynnikov@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH vshard 2/6] test: sort some table prints' \ /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