summaryrefslogtreecommitdiff
path: root/test/suite/test_cursor_random.py
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-08-08 16:29:45 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-08-08 16:29:45 -0400
commit058caddbcfb18256cd590b140c727ec4b0c8c9c4 (patch)
tree715431ad7c345d29779fa1fd7222092309b20f3b /test/suite/test_cursor_random.py
parentbde5219d3b6e982f8563a5218b807c74ac5e2620 (diff)
parent61f03c86bef993d25dcaab730357ceabc23683ca (diff)
downloadmongo-058caddbcfb18256cd590b140c727ec4b0c8c9c4.tar.gz
Merge branch 'develop' into wt-1967-evict-any
Diffstat (limited to 'test/suite/test_cursor_random.py')
-rw-r--r--test/suite/test_cursor_random.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/suite/test_cursor_random.py b/test/suite/test_cursor_random.py
index be08c59210f..10a3140a2fd 100644
--- a/test/suite/test_cursor_random.py
+++ b/test/suite/test_cursor_random.py
@@ -92,7 +92,7 @@ class test_cursor_random(wttest.WiredTigerTestCase):
# 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):
+ def cursor_random_multiple_page_records(self, reopen):
uri = self.type + 'random'
if self.type == 'file:':
simple_populate(self, uri,
@@ -103,10 +103,10 @@ class test_cursor_random(wttest.WiredTigerTestCase):
'allocation_size=512,leaf_page_max=512,key_format=' +\
self.fmt, 10000)
- # Close the connection so everything is forced to disk (otherwise the
- # values are on an insert list and the underlying engine doesn't make
- # random selections, it selects the middle of the list.
- self.reopen_conn()
+ # Optionally close the connection so everything is forced to disk,
+ # insert lists are an entirely different path in the code.
+ if reopen:
+ self.reopen_conn()
cursor = self.session.open_cursor(uri, None, "next_random=true")
last = ''
@@ -120,6 +120,10 @@ class test_cursor_random(wttest.WiredTigerTestCase):
self.assertLess(match, 5,
'next_random did not return random records, too many matches found')
+ def test_cursor_random_multiple_page_records_reopen(self):
+ self.cursor_random_multiple_page_records(1)
+ def test_cursor_random_multiple_page_records(self):
+ self.cursor_random_multiple_page_records(0)
# Check that opening a random cursor on column-store returns not-supported.
class test_cursor_random_column(wttest.WiredTigerTestCase):