From 28d5eab6c653214a59e687cb185f656b019f6c34 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Mon, 22 Jan 2024 18:13:30 +0300 Subject: [PATCH] test: refer to storage server by id Index alias provide stable info on instance nature, yet servers list index doesn't. --- test/integration/borders_test.lua | 2 +- test/integration/custom_bucket_id_test.lua | 2 +- test/integration/pairs_test.lua | 2 +- test/integration/select_readview_test.lua | 6 +++--- test/integration/select_test.lua | 2 +- test/integration/truncate_test.lua | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/integration/borders_test.lua b/test/integration/borders_test.lua index 511b4662..286a973e 100644 --- a/test/integration/borders_test.lua +++ b/test/integration/borders_test.lua @@ -12,7 +12,7 @@ local pgroup = t.group('borders', helpers.backend_matrix({ pgroup.before_all(function(g) helpers.start_default_cluster(g, 'srv_select') - g.space_format = g.cluster.servers[2].net_box.space.customers:format() + g.space_format = g.cluster:server('s1-master').net_box.space.customers:format() end) pgroup.after_all(function(g) diff --git a/test/integration/custom_bucket_id_test.lua b/test/integration/custom_bucket_id_test.lua index e4063484..c0338d5d 100644 --- a/test/integration/custom_bucket_id_test.lua +++ b/test/integration/custom_bucket_id_test.lua @@ -12,7 +12,7 @@ local pgroup = t.group('custom_bucket_id', helpers.backend_matrix({ pgroup.before_all(function(g) helpers.start_default_cluster(g, 'srv_simple_operations') - g.space_format = g.cluster.servers[2].net_box.space.customers:format() + g.space_format = g.cluster:server('s1-master').net_box.space.customers:format() end) pgroup.after_all(function(g) diff --git a/test/integration/pairs_test.lua b/test/integration/pairs_test.lua index e291457b..38bb3bf9 100644 --- a/test/integration/pairs_test.lua +++ b/test/integration/pairs_test.lua @@ -12,7 +12,7 @@ local pgroup = t.group('pairs', helpers.backend_matrix({ pgroup.before_all(function(g) helpers.start_default_cluster(g, 'srv_select') - g.space_format = g.cluster.servers[2].net_box.space.customers:format() + g.space_format = g.cluster:server('s1-master').net_box.space.customers:format() g.cluster.main_server.net_box:eval([[ require('crud').cfg{ stats = true } diff --git a/test/integration/select_readview_test.lua b/test/integration/select_readview_test.lua index b851ae6b..78f33169 100644 --- a/test/integration/select_readview_test.lua +++ b/test/integration/select_readview_test.lua @@ -15,7 +15,7 @@ local pgroup = t.group('select_readview', helpers.backend_matrix({ local function init_cluster(g) helpers.start_default_cluster(g, 'srv_select') - g.space_format = g.cluster.servers[2].net_box.space.customers:format() + g.space_format = g.cluster:server('s1-master').net_box.space.customers:format() g.router = helpers.get_router(g.cluster, g.params.backend) g.router.net_box:eval([[ @@ -2372,7 +2372,7 @@ pgroup.test_select_switch_master = function(g) t.assert_equals(err, nil) local replicasets = helpers.get_test_cartridge_replicasets() - set_master(g.cluster, replicasets[2].uuid, replicasets[2].servers[2].instance_uuid) + set_master(g.cluster, replicasets[2].uuid, replicasets[2]:server('s1-master').instance_uuid) local obj, err = g.cluster.main_server.net_box:eval([[ local crud = require('crud') @@ -2428,7 +2428,7 @@ pgroup.test_select_switch_master_first = function(g) t.assert_equals(objects, helpers.get_objects_by_idxs(customers, {1, 2})) local replicasets = helpers.get_test_cartridge_replicasets() - set_master(g.cluster, replicasets[3].uuid, replicasets[3].servers[2].instance_uuid) + set_master(g.cluster, replicasets[3].uuid, replicasets[3]:server('s1-master').instance_uuid) local obj, err = g.cluster.main_server.net_box:eval([[ local crud = require('crud') diff --git a/test/integration/select_test.lua b/test/integration/select_test.lua index e5a02e45..01cca1b8 100644 --- a/test/integration/select_test.lua +++ b/test/integration/select_test.lua @@ -13,7 +13,7 @@ local pgroup = t.group('select', helpers.backend_matrix({ pgroup.before_all(function(g) helpers.start_default_cluster(g, 'srv_select') - g.space_format = g.cluster.servers[2].net_box.space.customers:format() + g.space_format = g.cluster:server('s1-master').net_box.space.customers:format() g.router = helpers.get_router(g.cluster, g.params.backend) g.router.net_box:eval([[ diff --git a/test/integration/truncate_test.lua b/test/integration/truncate_test.lua index b766dd96..ec663dde 100644 --- a/test/integration/truncate_test.lua +++ b/test/integration/truncate_test.lua @@ -10,7 +10,7 @@ local pgroup = t.group('truncate', helpers.backend_matrix({ pgroup.before_all(function(g) helpers.start_default_cluster(g, 'srv_select') - g.space_format = g.cluster.servers[2].net_box.space.customers:format() + g.space_format = g.cluster:server('s1-master').net_box.space.customers:format() end) pgroup.after_all(function(g)