commit 2c422a0b98675cab480ebb44256dfeb72bd2f820 from: Sergey Ostanevich via: Serge Petrenko <35663196+sergepetrenko@users.noreply.github.com> date: Fri Nov 17 14:06:17 2023 UTC test: fixup the 1mops perf test The option --sync was ignored due to a misprint. The temporary dir was never removed, overflowing the /tmp by default. NO_TEST=test update NO_DOC=test update NO_CHANGELOG=test update commit - e99f6cb094fc978346eda9000d0b7e6e0b2a2fbb commit + 2c422a0b98675cab480ebb44256dfeb72bd2f820 blob - 79652bd487ae771346bab11877a0b329f0573d8c blob + facd3b1d558e38e58f18e3cff307c1a24a83059c --- perf/lua/1mops_write.lua +++ perf/lua/1mops_write.lua @@ -28,12 +28,25 @@ local params = require('internal.argparse').parse(arg, local test_dir = fio.tempdir() +local function rmtree(s) + if (fio.path.is_file(s) or fio.path.is_link(s)) then + fio.unlink(s) + return + end + if fio.path.is_dir(s) then + for _,i in pairs(fio.listdir(s)) do + rmtree(s..'/'..i) + end + fio.rmdir(s) + end +end + local function exit(res, details) if (details ~= nil) then print(details) end if test_dir ~= nil then - fio.rmdir(test_dir) + rmtree(test_dir) test_dir = nil end os.exit(res) @@ -66,8 +79,8 @@ if params.help or params.h then exit(0) end --- turn true to test the qsync -local test_qsync = params.qsync or false +-- turn true to test the synchronous replication +local test_sync = params.sync or false -- number of operations performed by test local num_ops = params.ops or 10000000 @@ -193,7 +206,7 @@ local space local done = false local err -if (test_qsync) then +if (test_sync) then box.cfg{replication_synchro_quorum = nodes} print('# promoting') box.ctl.promote()