|
133 | 133 | -- it's not check tarantool or vinyl as engine
|
134 | 134 | -- just check expirationd task continue work after conflicts
|
135 | 135 | function g.test_mvcc_vinyl_tx_conflict(cg)
|
136 |
| - t.skip('Broken on vinyl') |
137 | 136 | t.skip_if(cg.params.engine ~= 'vinyl', 'Unsupported engine')
|
138 | 137 |
|
139 | 138 | for i = 1,10 do
|
@@ -171,18 +170,26 @@ function g.test_mvcc_vinyl_tx_conflict(cg)
|
171 | 170 | task:kill()
|
172 | 171 | end
|
173 | 172 |
|
| 173 | +-- Create a task that use atomic_iteration and check that task is gone after |
| 174 | +-- kill. |
174 | 175 | function g.test_kill_task(cg)
|
175 |
| - for i = 1,1024*10 do |
| 176 | + local task_name = 'clean_all' |
| 177 | + |
| 178 | + for i = 1, 100 do |
176 | 179 | cg.space:insert({i, tostring(i)})
|
177 | 180 | end
|
178 | 181 |
|
179 |
| - local task = expirationd.start("clean_all", cg.space.id, helpers.is_expired_debug, |
180 |
| - {atomic_iteration = true}) |
181 |
| - |
| 182 | + local task = expirationd.start(task_name, cg.space.id, helpers.is_expired_debug, { |
| 183 | + atomic_iteration = true, |
| 184 | + tuples_per_iteration = 10, |
| 185 | + }) |
182 | 186 | task:kill()
|
183 |
| - t.assert(cg.space:count() > 0) |
184 |
| - t.assert(cg.space:count() % 1024 == 0) |
185 | 187 |
|
186 |
| - -- return to default value |
187 |
| - box.cfg{vinyl_memory = 134217728} |
| 188 | + -- There are two methods to know about task state: |
| 189 | + -- expirationd.task(task_name) and expirationd.stats() that returns |
| 190 | + -- statistics for each task. expirationd.task(task_name) raise error if |
| 191 | + -- task is not found. So we use stats() here and check that there are no |
| 192 | + -- stats for task with our task name. |
| 193 | + local stats = expirationd.stats() |
| 194 | + t.assert_equals(stats[task_name], nil) |
188 | 195 | end
|
0 commit comments