Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH 4/4] test: improve vinyl/select_consistency
Date: Tue, 15 May 2018 17:08:40 +0300	[thread overview]
Message-ID: <daf6c9098760801de60efb6855a3695f9856b018.1526392563.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1526392563.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1526392563.git.vdavydov.dev@gmail.com>

Improve the test by decreasing range_size so that it creates a lot of
ranges for test indexes, not just one. This helped find bugs causing
the crash described in #3393.

Follow-up #3393
---
 test/vinyl/select_consistency.result   | 11 +++++++----
 test/vinyl/select_consistency.test.lua |  9 +++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/test/vinyl/select_consistency.result b/test/vinyl/select_consistency.result
index 537f0613..c8f19cac 100644
--- a/test/vinyl/select_consistency.result
+++ b/test/vinyl/select_consistency.result
@@ -10,13 +10,13 @@ math.randomseed(os.time())
 s = box.schema.space.create('test', {engine = 'vinyl'})
 ---
 ...
-_ = s:create_index('pk', {parts = {1, 'unsigned'}})
+_ = s:create_index('pk', {parts = {1, 'unsigned'}, page_size = 64, range_size = 256})
 ---
 ...
-_ = s:create_index('i1', {unique = true, parts = {2, 'unsigned', 3, 'unsigned'}})
+_ = s:create_index('i1', {unique = true, parts = {2, 'unsigned', 3, 'unsigned'}, page_size = 64, range_size = 256})
 ---
 ...
-_ = s:create_index('i2', {unique = true, parts = {2, 'unsigned', 4, 'unsigned'}})
+_ = s:create_index('i2', {unique = true, parts = {2, 'unsigned', 4, 'unsigned'}, page_size = 64, range_size = 256})
 ---
 ...
 --
@@ -29,13 +29,16 @@ MAX_KEY = 100
 MAX_VAL = 10
 ---
 ...
+PADDING = string.rep('x', 100)
+---
+...
 test_run:cmd("setopt delimiter ';'")
 ---
 - true
 ...
 function gen_insert()
     pcall(s.insert, s, {math.random(MAX_KEY), math.random(MAX_VAL),
-                        math.random(MAX_VAL), math.random(MAX_VAL), 1})
+                        math.random(MAX_VAL), math.random(MAX_VAL), PADDING})
 end;
 ---
 ...
diff --git a/test/vinyl/select_consistency.test.lua b/test/vinyl/select_consistency.test.lua
index c29cb8ac..90fcf67e 100644
--- a/test/vinyl/select_consistency.test.lua
+++ b/test/vinyl/select_consistency.test.lua
@@ -5,9 +5,9 @@ fiber = require 'fiber'
 math.randomseed(os.time())
 
 s = box.schema.space.create('test', {engine = 'vinyl'})
-_ = s:create_index('pk', {parts = {1, 'unsigned'}})
-_ = s:create_index('i1', {unique = true, parts = {2, 'unsigned', 3, 'unsigned'}})
-_ = s:create_index('i2', {unique = true, parts = {2, 'unsigned', 4, 'unsigned'}})
+_ = s:create_index('pk', {parts = {1, 'unsigned'}, page_size = 64, range_size = 256})
+_ = s:create_index('i1', {unique = true, parts = {2, 'unsigned', 3, 'unsigned'}, page_size = 64, range_size = 256})
+_ = s:create_index('i2', {unique = true, parts = {2, 'unsigned', 4, 'unsigned'}, page_size = 64, range_size = 256})
 
 --
 -- If called from a transaction, i1:select({k}) and i2:select({k})
@@ -16,12 +16,13 @@ _ = s:create_index('i2', {unique = true, parts = {2, 'unsigned', 4, 'unsigned'}}
 
 MAX_KEY = 100
 MAX_VAL = 10
+PADDING = string.rep('x', 100)
 
 test_run:cmd("setopt delimiter ';'")
 
 function gen_insert()
     pcall(s.insert, s, {math.random(MAX_KEY), math.random(MAX_VAL),
-                        math.random(MAX_VAL), math.random(MAX_VAL), 1})
+                        math.random(MAX_VAL), math.random(MAX_VAL), PADDING})
 end;
 
 function gen_delete()
-- 
2.11.0

      parent reply	other threads:[~2018-05-15 14:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 14:08 [PATCH 0/4] vinyl: fix crash in vinyl_iterator_secondary_next() Vladimir Davydov
2018-05-15 14:08 ` [PATCH 1/4] vinyl: fix EQ check in run iterator Vladimir Davydov
2018-05-15 19:05   ` Konstantin Osipov
2018-05-15 19:23     ` Vladimir Davydov
2018-05-15 14:08 ` [PATCH 2/4] vinyl: fix lost key on dump completion Vladimir Davydov
2018-05-15 19:20   ` Konstantin Osipov
2018-05-15 19:27     ` Vladimir Davydov
2018-05-15 14:08 ` [PATCH 3/4] vinyl: do not panic if secondary index is inconsistent with primary Vladimir Davydov
2018-05-15 14:08 ` Vladimir Davydov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=daf6c9098760801de60efb6855a3695f9856b018.1526392563.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 4/4] test: improve vinyl/select_consistency' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox