-
Notifications
You must be signed in to change notification settings - Fork 1
/
suite-stability-tests.lua
204 lines (195 loc) · 10.4 KB
/
suite-stability-tests.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
local bwlimit_keys = 500
local main_keys = 1000000
local clients = 20
local client_high = clients * 20
local suite_sets = {
{ "main", { "cluster", "ccluster", "wcluster", "wccluster", "wzone", "zone", "zonegood", "wzonegood", "subcluster", "subwcluster", "onewaitwc", "onewait", "onewaitfg", "internal" } },
{ "bwlimit", { "cluster", "ccluster", "wcluster", "zone", "wzone", "zonegood", "wzonegood", "subcluster", "subwcluster", "onewaitwc", "onewait", "onewaitfg" } },
{ "fault", { "cluster", "ccluster", "wcluster", "zone", "zonegood", "wzonegood", "subcluster", "subwcluster", "onewaitwc", "onewaitfg" } },
}
local test_args = {
bwlimit = { prefix = "/main/", total_keys = bwlimit_keys, vsize = 800000,
ttl = 0, pipelines = 10 },
main = { prefix = "/main/", total_keys = main_keys, vsize = 100,
ttl = 0, pipelines = 60 },
fault = { prefix = "/main/", total_keys = main_keys, vsize = 100,
ttl = 0, pipelines = 20 },
}
local warmers = {
main = function(pfx, t)
mcs.add_custom(t.w, { func = "stability_warm" }, { limit = main_keys, prefix = pfx, vsize = 100 })
mcs.shredder({t.w})
end,
bwlimit = function(pfx, t)
mcs.add_custom(t.w, { func = "stability_warm" }, { limit = bwlimit_keys, prefix = pfx, vsize = 800000 })
mcs.shredder({t.w})
end,
fault = function(pfx)
-- no-op?
end,
}
local tests_s = {
{p = "main", n = "getters", f = function(a, t)
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 0, init = true}, a)
end},
{p = "main", n = "setters", f = function(a, t)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 0}, a)
end},
{p = "main", n = "multiget", f = function(a, t)
mcs.add(t.t, { func = "runner_multiget", clients = clients, rate_limit = 0}, a)
end},
{p = "main", n = "highgetters", f = function(a, t)
mcs.add(t.t, { func = "runner_metaget", clients = clients_high, rate_limit = 0, init = true}, a)
end},
{p = "main", n = "highsetters", f = function(a, t)
mcs.add(t.t, { func = "runner_metaset", clients = clients_high, rate_limit = 0}, a)
end},
{p = "main", n = "highmultiget", f = function(a, t)
mcs.add(t.t, { func = "runner_multiget", clients = clients_high, rate_limit = 0}, a)
end},
{p = "main", n = "highreconngetters", f = function(a, t)
mcs.add(t.t, { func = "runner_metaget", clients = clients_high, rate_limit = 0, init = true, reconn_every = 3}, a)
end},
{p = "main", n = "highreconnsetters", f = function(a, t)
mcs.add(t.t, { func = "runner_metaset", clients = clients_high, rate_limit = 0, reconn_every = 3}, a)
end},
{p = "main", n = "highreconnmultiget", f = function(a, t)
mcs.add(t.t, { func = "runner_multiget", clients = clients_high, rate_limit = 0, reconn_every = 3}, a)
end},
-- the next few tests can remove items.
{p = "main", n = "setdel", f = function(a, t)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 0}, a)
mcs.add(t.t, { func = "runner_metadelete", clients = clients, rate_limit = 0, init = true}, a)
end},
{p = "main", n = "setpipedel", f = function(a, t)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 0}, a)
mcs.add(t.t, { func = "runner_batchmetadelete", clients = 1, rate_limit = 0}, a)
end},
{p = "main", n = "getsetdel", f = function(a, t)
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 0, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 0}, a)
mcs.add(t.t, { func = "runner_metadelete", clients = clients, rate_limit = 0, init = true}, a)
end},
{p = "main", n = "highmgpipe", f = function(a, t)
mcs.add(t.t, { func = "runner_metagetpipe", clients = clients, rate_limit = 0, init = true},
{ prefix = a.prefix, total_keys = a.total_keys, pipelines = 250 })
end},
{p = "main", n = "basicgetset", f = function(a, t)
-- use a different prefix so we can test natural loading.
mcs.add(t.t, { func = "runner_basic", clients = clients, rate_limit = 0},
{ prefix = a.prefix .. "basicgetset", total_keys = a.total_keys, vsize = 100, ttl = 90 })
end},
{p = "main", n = "basicpipe", f = function(a, t)
-- use a different prefix to test natural loading.
mcs.add(t.t, { func = "runner_basicpipe", clients = clients, rate_limit = 0},
{ prefix = a.prefix .. "basicpipe", total_keys = a.total_keys, vsize = 100, ttl = 90, pipelines = 60 })
end},
{p = "main", n = "metavariable", f = function(a, t)
-- use a different prefix to test natural loading.
mcs.add(t.t, { func = "runner_metabasic_variable", clients = clients, rate_limit = 0},
{ prefix = a.prefix .. "mbvar", total_keys = a.total_keys, sizemin = 10, sizemax = 9000, ttl = 90 })
end},
{p = "bwlimit", n = "getters", s = true, f = function(a, t, go)
nodectrl("bwlimit mc-proxy");
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 0, init = true}, a)
go(a)
nodectrl("nobwlimit mc-proxy");
end},
{p = "bwlimit", n = "setters", s = true, f = function(a, t, go)
nodectrl("bwlimit mc-proxy");
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 0}, a)
go(a)
nodectrl("nobwlimit mc-proxy");
end},
{p = "bwlimit", n = "multiget", s = true, f = function(a, t, go)
nodectrl("bwlimit mc-proxy");
mcs.add(t.t, { func = "runner_multiget", clients = clients, rate_limit = 0}, a)
go(a)
nodectrl("nobwlimit mc-proxy");
-- throw a small value test immediately after the bandwidth
-- limiter to confirm if memory usage clears.
local second_args = { total_keys = a.total_keys, vsize = 100, ttl = 0 }
second_args.prefix = a.prefix .. 'extra'
mcs.add(t.t, { func = "runner_basic", clients = clients, rate_limit = 5000}, second_args)
go(second_args)
end},
{p = "fault", n = "reload", s = true, f = function(a, t, go)
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 50000, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 5000}, a)
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
mcs.add(t.m, { func = "runner_reload", clients = 1, rate_limit = 1}, a)
go(a)
end},
{p = "fault", n = "reloadmultiget", s = true, f = function(a, t, go)
mcs.add(t.t, { func = "runner_multiget", clients = clients, rate_limit = 5000}, a)
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
mcs.add(t.m, { func = "runner_reload", clients = 1, rate_limit = 1}, a)
go(a)
end},
{p = "fault", n = "lag", s = true, f = function(a, t, go)
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 50000, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 5000}, a)
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
mcs.add(t.m, { func = "runner_delay", clients = 1, rate_limit = 1},
{ node = "mc-node1", delay = "500ms", _c = 0 })
go(a)
nodectrl("clear mc-node1")
end},
{p = "fault", n = "reloadlag", s = true, f = function(a, t, go)
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 50000, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 5000}, a)
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
mcs.add(t.m, { func = "runner_delay", clients = 1, rate_limit = 1},
{ node = "mc-node1", delay = "500ms", _c = 0 })
mcs.add(t.m, { func = "runner_reload", clients = 1, rate_limit = 5}, a)
go(a)
nodectrl("clear mc-node1")
end},
{p = "fault", n = "ploss", s = true, f = function(a, t, go)
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 50000, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 5000}, a)
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
mcs.add(t.m, { func = "runner_ploss", clients = 1, rate_limit = 1, period = 2000 },
{ node = "mc-node1", ploss = "10%", _c = 0 })
go(a)
nodectrl("clear mc-node1")
end},
{p = "fault", n = "block", s = true, f = function(a, t, go)
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 50000, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 5000}, a)
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
mcs.add(t.m, { func = "runner_block", clients = 1, rate_limit = 1, period = 2000 },
{ node = "mc-node1", _c = 0 })
go(a)
nodectrl("unblock mc-node1")
end},
{p = "fault", n = "bigblock", s = true, f = function(a, t, go)
mcs.add(t.t, { func = "runner_metaget", clients = clients * 400, rate_limit = 200000, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 5000}, a)
mcs.add(t.m, { func = "runner_block", clients = 1, rate_limit = 1, rate_period = 4000 },
{ node = "mc-node1", _c = 0 })
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
go(a)
nodectrl("unblock mc-node1")
end},
{p = "fault", n = "blocked", s = true, f = function(a, t, go)
-- we leave the node blocked for the entire duration of the test.
-- request rate should be stable.
nodectrl("block mc-node1")
mcs.add(t.t, { func = "runner_metaget", clients = clients, rate_limit = 50000, init = true}, a)
mcs.add(t.t, { func = "runner_metaset", clients = clients, rate_limit = 5000}, a)
mcs.add_custom(t.s, { func = "runner_watcher" }, { watchers = "proxyevents" })
go(a)
nodectrl("unblock mc-node1")
end},
}
-- color the tests with common data and functions.
for _, test in pairs(tests_s) do
test.a = test_args[test.p]
test.w = warmers[test.p]
end
local r = {
tests = tests_s,
sets = suite_sets
}
return r