commit e94c9e2762a0cdabb2d4be7acb6c8370928f0e62 from: Sergey Bronnikov date: Tue Oct 08 14:29:26 2024 UTC test: fix test filename According to CMake policy CMP0110 whitespaces and other special characters are forbidden before CMake 3.19. This policy is triggered with the patch for CTest support and breaks test generation: NO_WRAP The following name given to add_test() is invalid if CMP0110 is not set or set to OLD: `test/box-luatest/gh_7217_repeatable_{in, up}sert_memtx_tx_conflict_test.lua´ NO_WRAP The patch renames file without using whitespaces and special characters. Required for CTest support. Follows up commit 654cf498662c ("memtx: fix story delete statement list"). 1. https://cmake.org/cmake/help/latest/policy/CMP0110.html NO_CHANGELOG=codehealth NO_DOC=codehealth NO_TEST=codehealth (cherry picked from commit ec810b9d6b618c4ec5116dde2f02b5be01a13f6d) commit - 92d846cfba12f8d85ed9d37d544a8d0970d2c15b commit + e94c9e2762a0cdabb2d4be7acb6c8370928f0e62 blob - e2de42c83766291c5030cd3a663fb59765d0bd3f (mode 644) blob + /dev/null --- test/box-luatest/gh_7217_repeatable_{in, up}sert_memtx_tx_conflict_test.lua +++ /dev/null @@ -1,120 +0,0 @@ -local server = require('luatest.server') -local t = require('luatest') - -local g = t.group() - -g.before_all(function() - g.server = server:new{ - alias = 'dflt', - box_cfg = {memtx_use_mvcc_engine = true} - } - g.server:start() -end) - -g.after_all(function() - g.server:drop() -end) - -g.after_each(function() - g.server:exec(function() - box.space.s:drop() - end) -end) - -g.test_repeatable_insert_primary_idx = function() - g.server:exec(function() - local txn_proxy = require('test.box.lua.txn_proxy') - - local s = box.schema.create_space('s') - s:create_index('pk') - - local tx1 = txn_proxy:new() - local tx2 = txn_proxy:new() - - tx1('box.begin()') - tx2('box.begin()') - - tx1('box.space.s:replace{0, 0}') - - tx2('box.space.s:replace{0, 1}') - tx2('box.space.s:delete{0}') - tx2('box.space.s:insert{0, 2}') - - tx1('box.commit()') - t.assert_equals(tx2:commit(), "") - end) -end - -g.test_repeatable_insert_secondary_idx = function() - g.server:exec(function() - local txn_proxy = require('test.box.lua.txn_proxy') - - local s = box.schema.create_space('s') - s:create_index('pk') - s:create_index('sk', {parts = {2, 'unsigned'}}) - - local tx1 = txn_proxy:new() - local tx2 = txn_proxy:new() - - tx1('box.begin()') - tx2('box.begin()') - - tx1('box.space.s:replace{0, 0, 0}') - - tx2('box.space.s:replace{0, 0, 1}') - tx2('box.space.s:delete{0}') - tx2('box.space.s:insert{0, 0, 2}') - - tx1('box.commit()') - t.assert_equals(tx2:commit(), "") - end) -end - -g.test_repeatable_upsert_primary_idx = function() - g.server:exec(function() - local txn_proxy = require('test.box.lua.txn_proxy') - - local s = box.schema.create_space('s') - s:create_index('pk') - - local tx1 = txn_proxy:new() - local tx2 = txn_proxy:new() - - tx1('box.begin()') - tx2('box.begin()') - - tx1('box.space.s:replace{0, 0}') - - tx2('box.space.s:replace{0, 1}') - tx2('box.space.s:delete{0}') - tx2('box.space.s:upsert({0, 2}, {{"=", 2, 2}})') - - tx1('box.commit()') - t.assert_equals(tx2:commit(), "") - end) -end - -g.test_repeatable_upsert_primary_idx = function() - g.server:exec(function() - local txn_proxy = require('test.box.lua.txn_proxy') - - local s = box.schema.create_space('s') - s:create_index('pk') - s:create_index('sk', {parts = {2, 'unsigned'}}) - - local tx1 = txn_proxy:new() - local tx2 = txn_proxy:new() - - tx1('box.begin()') - tx2('box.begin()') - - tx1('box.space.s:replace{0, 0, 0}') - - tx2('box.space.s:replace{0, 0, 1}') - tx2('box.space.s:delete{0}') - tx2('box.space.s:upsert({0, 0, 2}, {{"=", 3, 2}})') - - tx1('box.commit()') - t.assert_equals(tx2:commit(), "") - end) -end blob - /dev/null blob + e2de42c83766291c5030cd3a663fb59765d0bd3f (mode 644) --- /dev/null +++ test/box-luatest/gh_7217_repeatable_in_up_sert_memtx_tx_conflict_test.lua @@ -0,0 +1,120 @@ +local server = require('luatest.server') +local t = require('luatest') + +local g = t.group() + +g.before_all(function() + g.server = server:new{ + alias = 'dflt', + box_cfg = {memtx_use_mvcc_engine = true} + } + g.server:start() +end) + +g.after_all(function() + g.server:drop() +end) + +g.after_each(function() + g.server:exec(function() + box.space.s:drop() + end) +end) + +g.test_repeatable_insert_primary_idx = function() + g.server:exec(function() + local txn_proxy = require('test.box.lua.txn_proxy') + + local s = box.schema.create_space('s') + s:create_index('pk') + + local tx1 = txn_proxy:new() + local tx2 = txn_proxy:new() + + tx1('box.begin()') + tx2('box.begin()') + + tx1('box.space.s:replace{0, 0}') + + tx2('box.space.s:replace{0, 1}') + tx2('box.space.s:delete{0}') + tx2('box.space.s:insert{0, 2}') + + tx1('box.commit()') + t.assert_equals(tx2:commit(), "") + end) +end + +g.test_repeatable_insert_secondary_idx = function() + g.server:exec(function() + local txn_proxy = require('test.box.lua.txn_proxy') + + local s = box.schema.create_space('s') + s:create_index('pk') + s:create_index('sk', {parts = {2, 'unsigned'}}) + + local tx1 = txn_proxy:new() + local tx2 = txn_proxy:new() + + tx1('box.begin()') + tx2('box.begin()') + + tx1('box.space.s:replace{0, 0, 0}') + + tx2('box.space.s:replace{0, 0, 1}') + tx2('box.space.s:delete{0}') + tx2('box.space.s:insert{0, 0, 2}') + + tx1('box.commit()') + t.assert_equals(tx2:commit(), "") + end) +end + +g.test_repeatable_upsert_primary_idx = function() + g.server:exec(function() + local txn_proxy = require('test.box.lua.txn_proxy') + + local s = box.schema.create_space('s') + s:create_index('pk') + + local tx1 = txn_proxy:new() + local tx2 = txn_proxy:new() + + tx1('box.begin()') + tx2('box.begin()') + + tx1('box.space.s:replace{0, 0}') + + tx2('box.space.s:replace{0, 1}') + tx2('box.space.s:delete{0}') + tx2('box.space.s:upsert({0, 2}, {{"=", 2, 2}})') + + tx1('box.commit()') + t.assert_equals(tx2:commit(), "") + end) +end + +g.test_repeatable_upsert_primary_idx = function() + g.server:exec(function() + local txn_proxy = require('test.box.lua.txn_proxy') + + local s = box.schema.create_space('s') + s:create_index('pk') + s:create_index('sk', {parts = {2, 'unsigned'}}) + + local tx1 = txn_proxy:new() + local tx2 = txn_proxy:new() + + tx1('box.begin()') + tx2('box.begin()') + + tx1('box.space.s:replace{0, 0, 0}') + + tx2('box.space.s:replace{0, 0, 1}') + tx2('box.space.s:delete{0}') + tx2('box.space.s:upsert({0, 0, 2}, {{"=", 3, 2}})') + + tx1('box.commit()') + t.assert_equals(tx2:commit(), "") + end) +end