@@ -15,6 +15,8 @@ local cluster_alias = {
1515 tnt_storage_2_replica = ' tnt_storage_2_replica' ,
1616}
1717
18+ local instances = {}
19+
1820local replicasets = {
1921 {
2022 uuid = cluster_helpers .uuid (' a' ),
@@ -99,18 +101,16 @@ test.before_suite(function()
99101 }
100102 }
101103 })
104+
105+ for instance , alias in pairs (cluster_alias ) do
106+ instances [instance ] = group .cluster :server (alias )
107+ end
102108end )
103109
104110test .after_suite (function ()
105111 group .cluster :stop ()
106112end )
107113
108- local tnt_router = group .cluster :server (cluster_alias .tnt_router )
109- local tnt_storage_1_master = group .cluster :server (cluster_alias .tnt_storage_1_master )
110- local tnt_storage_1_replica = group .cluster :server (cluster_alias .tnt_storage_1_replica )
111- local tnt_storage_2_master = group .cluster :server (cluster_alias .tnt_storage_2_master )
112- local tnt_storage_2_replica = group .cluster :server (cluster_alias .tnt_storage_2_replica )
113-
114114-- Space operations constants
115115local SELECT = ' select'
116116local INSERT = ' insert'
@@ -194,39 +194,39 @@ group.test_cluster = function()
194194 test .helpers .retrying ({ timeout = math.huge },
195195 function ()
196196 -- Generate some HTTP traffic
197- http_request (tnt_router , GET , ' /hello' , math.random (5 , 10 ))
198- http_request (tnt_router , GET , ' /hell0' , math.random (1 , 2 ))
199- http_request (tnt_router , POST , ' /goodbye' , math.random (0 , 1 ))
200- http_request (tnt_storage_1_master , GET , ' /hello' , math.random (2 , 5 ))
201- http_request (tnt_storage_1_master , GET , ' /hell0' , math.random (0 , 1 ))
202- http_request (tnt_storage_1_master , POST , ' /goodbye' , math.random (0 , 1 ))
203- http_request (tnt_storage_1_replica , GET , ' /hello' , math.random (1 , 3 ))
204- http_request (tnt_storage_1_replica , GET , ' /hell0' , math.random (0 , 1 ))
205- http_request (tnt_storage_1_replica , POST , ' /goodbye' , math.random (0 , 1 ))
206- http_request (tnt_storage_2_master , GET , ' /hello' , math.random (2 , 5 ))
207- http_request (tnt_storage_2_master , GET , ' /hell0' , math.random (0 , 1 ))
208- http_request (tnt_storage_2_master , POST , ' /goodbye' , math.random (0 , 1 ))
209- http_request (tnt_storage_2_replica , GET , ' /hello' , math.random (1 , 3 ))
210- http_request (tnt_storage_2_replica , GET , ' /hell0' , math.random (0 , 1 ))
211- http_request (tnt_storage_2_replica , POST , ' /goodbye' , math.random (0 , 1 ))
197+ http_request (instances . tnt_router , GET , ' /hello' , math.random (5 , 10 ))
198+ http_request (instances . tnt_router , GET , ' /hell0' , math.random (1 , 2 ))
199+ http_request (instances . tnt_router , POST , ' /goodbye' , math.random (0 , 1 ))
200+ http_request (instances . tnt_storage_1_master , GET , ' /hello' , math.random (2 , 5 ))
201+ http_request (instances . tnt_storage_1_master , GET , ' /hell0' , math.random (0 , 1 ))
202+ http_request (instances . tnt_storage_1_master , POST , ' /goodbye' , math.random (0 , 1 ))
203+ http_request (instances . tnt_storage_1_replica , GET , ' /hello' , math.random (1 , 3 ))
204+ http_request (instances . tnt_storage_1_replica , GET , ' /hell0' , math.random (0 , 1 ))
205+ http_request (instances . tnt_storage_1_replica , POST , ' /goodbye' , math.random (0 , 1 ))
206+ http_request (instances . tnt_storage_2_master , GET , ' /hello' , math.random (2 , 5 ))
207+ http_request (instances . tnt_storage_2_master , GET , ' /hell0' , math.random (0 , 1 ))
208+ http_request (instances . tnt_storage_2_master , POST , ' /goodbye' , math.random (0 , 1 ))
209+ http_request (instances . tnt_storage_2_replica , GET , ' /hello' , math.random (1 , 3 ))
210+ http_request (instances . tnt_storage_2_replica , GET , ' /hell0' , math.random (0 , 1 ))
211+ http_request (instances . tnt_storage_2_replica , POST , ' /goodbye' , math.random (0 , 1 ))
212212
213213 -- Generate some space traffic
214- space_operations (tnt_router , INSERT , math.random (1 , 3 ))
215- space_operations (tnt_router , UPDATE , math.random (1 , 3 ))
216- space_operations (tnt_storage_1_master , INSERT , math.random (5 , 10 ))
217- space_operations (tnt_storage_1_master , SELECT , math.random (10 , 20 ))
218- space_operations (tnt_storage_1_master , UPDATE , math.random (5 , 10 ))
219- space_operations (tnt_storage_1_master , UPSERT , math.random (5 , 10 ))
220- space_operations (tnt_storage_1_master , REPLACE , math.random (5 , 10 ))
221- space_operations (tnt_storage_1_master , DELETE , math.random (1 , 2 ))
222- space_operations (tnt_storage_1_replica , SELECT , math.random (3 , 5 ))
223- space_operations (tnt_storage_2_master , INSERT , math.random (5 , 10 ))
224- space_operations (tnt_storage_2_master , SELECT , math.random (10 , 20 ))
225- space_operations (tnt_storage_2_master , UPDATE , math.random (5 , 10 ))
226- space_operations (tnt_storage_2_master , UPSERT , math.random (5 , 10 ))
227- space_operations (tnt_storage_2_master , REPLACE , math.random (5 , 10 ))
228- space_operations (tnt_storage_2_master , DELETE , math.random (1 , 2 ))
229- space_operations (tnt_storage_2_replica , SELECT , math.random (3 , 5 ))
214+ space_operations (instances . tnt_router , INSERT , math.random (1 , 3 ))
215+ space_operations (instances . tnt_router , UPDATE , math.random (1 , 3 ))
216+ space_operations (instances . tnt_storage_1_master , INSERT , math.random (5 , 10 ))
217+ space_operations (instances . tnt_storage_1_master , SELECT , math.random (10 , 20 ))
218+ space_operations (instances . tnt_storage_1_master , UPDATE , math.random (5 , 10 ))
219+ space_operations (instances . tnt_storage_1_master , UPSERT , math.random (5 , 10 ))
220+ space_operations (instances . tnt_storage_1_master , REPLACE , math.random (5 , 10 ))
221+ space_operations (instances . tnt_storage_1_master , DELETE , math.random (1 , 2 ))
222+ space_operations (instances . tnt_storage_1_replica , SELECT , math.random (3 , 5 ))
223+ space_operations (instances . tnt_storage_2_master , INSERT , math.random (5 , 10 ))
224+ space_operations (instances . tnt_storage_2_master , SELECT , math.random (10 , 20 ))
225+ space_operations (instances . tnt_storage_2_master , UPDATE , math.random (5 , 10 ))
226+ space_operations (instances . tnt_storage_2_master , UPSERT , math.random (5 , 10 ))
227+ space_operations (instances . tnt_storage_2_master , REPLACE , math.random (5 , 10 ))
228+ space_operations (instances . tnt_storage_2_master , DELETE , math.random (1 , 2 ))
229+ space_operations (instances . tnt_storage_2_replica , SELECT , math.random (3 , 5 ))
230230
231231 -- Fail this function so cluster don't stop
232232 error (' running cluster' )
0 commit comments