Skip to content
Snippets Groups Projects
Commit 6bebc1b5 authored by Nikolay Shirokovskiy's avatar Nikolay Shirokovskiy Committed by Vladimir Davydov
Browse files

test: add test for #10148

The fix itself is in the small submodule which is bumped in the previous
commit.

Closes #10148

NO_DOC=bugfix

(cherry picked from commit e4ce9e111483a24d66e078f4f05679d309fcb94d)
parent e1bb094f
No related branches found
No related tags found
No related merge requests found
## bugfix/box
- Fixed a crash when `slab_alloc_factor` is low and memory pressure is high
(gh-10148).
local server = require('luatest.server')
local t = require('luatest')
local g = t.group()
g.before_all(function(cg)
cg.server = server:new({
box_cfg = {
slab_alloc_factor = 1.001,
memtx_memory = 64 * 1024 * 1024,
wal_mode = 'none',
}
})
cg.server:start()
end)
g.after_all(function(cg)
cg.server:drop()
end)
g.after_each(function(cg)
cg.server:exec(function()
if box.space.test ~= nil then
box.space.test:drop()
end
end)
end)
g.test_low_slab_alloc_factor = function(cg)
cg.server:exec(function()
local test = box.schema.create_space('test')
test:create_index('pri')
for i=1,1000000 do
local ok, err = pcall(test.insert, test, {i, string.rep('x', 1000)})
if not ok then
t.assert_equals(err:unpack().type, 'OutOfMemory')
break
end
end
end)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment