From f0445eaf53fa1ac279673f4c4b0ac95c007241f3 Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Mon, 16 Aug 2021 15:21:23 +0300 Subject: [PATCH] test: update printing results For getting stable results we need to run performance tests many times and then calculate mean, median and standard deviation for results. luatest has an option `-r N` that allows to run testcase N times, but it don't execute setup/teardown on each iteration [1] and due to this our testcases fails due to duplicated id's in a space. For running tests many times I made an external loop in a shell script: ``` for i in `seq 1 1 30`; do luatest -v -c test/performance/select_perf_test.lua 2>&1 | grep -E 'INSERT|SELECT'`; done ``` For more convenient extracting numbers from log I changed format of printing on each iteration - all numbers that changed from run to run printed in a single row, and removed printing numbers that are always static. 1. https://github.com/tarantool/luatest/issues/161 --- test/performance/select_perf_test.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/test/performance/select_perf_test.lua b/test/performance/select_perf_test.lua index 1e731103..683e7708 100644 --- a/test/performance/select_perf_test.lua +++ b/test/performance/select_perf_test.lua @@ -130,13 +130,8 @@ g.test_insert = function() fibers[i]:join() end - log.error('INSERT') - log.error('Fibers count - %d', fiber_count) - log.error('Connection count - %d', connection_count) - log.error('Timeout - %f', timeout) - log.error('Requests - %d', report.count) - log.error('Errors - %s', #report.errors) - log.error('RPS - %f', report.count / timeout) + log.error('\nINSERT: requests %d, rps %d, errors %d', + report.count, report.count / timeout, #report.errors) end g.test_select = function() @@ -167,11 +162,6 @@ g.test_select = function() fibers[i]:join() end - log.error('SELECT') - log.error('Fibers count - %d', fiber_count) - log.error('Connection count - %d', connection_count) - log.error('Timeout - %f', timeout) - log.error('Requests - %d', report.count) - log.error('Errors - %s', #report.errors) - log.error('RPS - %f', report.count / timeout) + log.error('\nSELECT: requests %d, rps %d, errors %d', + report.count, report.count / timeout, #report.errors) end