Skip to content

Commit e13b9d6

Browse files
Merge pull request #31 from tarantool/30-example-cluster-bug
Fix example cluster start
2 parents 11d7f77 + 82dd53f commit e13b9d6

File tree

2 files changed

+42
-37
lines changed

2 files changed

+42
-37
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
## Fixed
10+
- Example cluster now starts successfully
11+
712
## [0.1.1] - 2020-09-04
813
Grafana revisions: [InfluxDB revision 2](https://grafana.com/api/dashboards/12567/revisions/2/download)
914

example/project/cluster/integration/bootstrap_test.lua

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ local cluster_alias = {
1515
tnt_storage_2_replica = 'tnt_storage_2_replica',
1616
}
1717

18+
local instances = {}
19+
1820
local 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
102108
end)
103109

104110
test.after_suite(function()
105111
group.cluster:stop()
106112
end)
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
115115
local SELECT = 'select'
116116
local 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

Comments
 (0)