summaryrefslogtreecommitdiff
path: root/test/suite
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-06-14 12:45:34 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-06-14 12:45:34 -0400
commit38523f87419998c27f2fda2b7d1085576ccaab7b (patch)
tree1a79c935db052feeabccf45b27dbc6a6bde8ed52 /test/suite
parentf54c79d89eca18440bd594cfc04d44fbb2e943e9 (diff)
downloadmongo-38523f87419998c27f2fda2b7d1085576ccaab7b.tar.gz
Confirm WT_CURSOR.next_random works for both in-memory and on-disk
formats.
Diffstat (limited to 'test/suite')
-rw-r--r--test/suite/test_cursor_random.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/suite/test_cursor_random.py b/test/suite/test_cursor_random.py
index db05e1dbabb..f2fb180cdbd 100644
--- a/test/suite/test_cursor_random.py
+++ b/test/suite/test_cursor_random.py
@@ -71,8 +71,27 @@ class test_cursor_random(wttest.WiredTigerTestCase):
self.assertEquals(cursor.get_key(), 'AAA')
cursor.close
- # Check that next_random works in the presence of a larger set of values.
- def test_cursor_random_multiple_records(self):
+ # Check that next_random works in the presence of a larger set of values,
+ # where the values are in an insert list.
+ def test_cursor_random_multiple_insert_records(self):
+ uri = self.type + 'random'
+ if self.type == 'file:':
+ simple_populate(self, uri,
+ 'allocation_size=512,leaf_page_max=512,key_format=' +\
+ self.fmt, 10000)
+ else:
+ complex_populate(self, uri,
+ 'allocation_size=512,leaf_page_max=512,key_format=' +\
+ self.fmt, 10000)
+
+ # In a insert list, next_random always selects the middle key/value
+ # pair, all we can do is confirm cursor.next works.
+ cursor = self.session.open_cursor(uri, None, "next_random=true")
+ self.assertEqual(cursor.next(), 0)
+
+ # Check that next_random works in the presence of a larger set of values,
+ # where the values are in a disk format page.
+ def test_cursor_random_multiple_page_records(self):
uri = self.type + 'random'
if self.type == 'file:':
simple_populate(self, uri,