minor: test fix for change is core server cursorInfo command
This commit is contained in:
parent
dfcf8d9d60
commit
9eee412213
|
@ -300,7 +300,6 @@ class CursorTest < Test::Unit::TestCase
|
||||||
@@coll.drop
|
@@coll.drop
|
||||||
|
|
||||||
client_cursors = @@db.command("cursorInfo" => 1)["clientCursors_size"]
|
client_cursors = @@db.command("cursorInfo" => 1)["clientCursors_size"]
|
||||||
by_location = @@db.command("cursorInfo" => 1)["byLocation_size"]
|
|
||||||
|
|
||||||
10000.times do |i|
|
10000.times do |i|
|
||||||
@@coll.insert("i" => i)
|
@@coll.insert("i" => i)
|
||||||
|
@ -308,8 +307,6 @@ class CursorTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_equal(client_cursors,
|
assert_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
|
|
||||||
10.times do |i|
|
10.times do |i|
|
||||||
@@coll.find_one()
|
@@coll.find_one()
|
||||||
|
@ -317,8 +314,6 @@ class CursorTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_equal(client_cursors,
|
assert_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
|
|
||||||
10.times do |i|
|
10.times do |i|
|
||||||
a = @@coll.find()
|
a = @@coll.find()
|
||||||
|
@ -328,30 +323,22 @@ class CursorTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_equal(client_cursors,
|
assert_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
|
|
||||||
a = @@coll.find()
|
a = @@coll.find()
|
||||||
a.next_document
|
a.next_document
|
||||||
|
|
||||||
assert_not_equal(client_cursors,
|
assert_not_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_not_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
|
|
||||||
a.close()
|
a.close()
|
||||||
|
|
||||||
assert_equal(client_cursors,
|
assert_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
|
|
||||||
a = @@coll.find({}, :limit => 10).next_document
|
a = @@coll.find({}, :limit => 10).next_document
|
||||||
|
|
||||||
assert_equal(client_cursors,
|
assert_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
|
|
||||||
@@coll.find() do |cursor|
|
@@coll.find() do |cursor|
|
||||||
cursor.next_document
|
cursor.next_document
|
||||||
|
@ -359,8 +346,6 @@ class CursorTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_equal(client_cursors,
|
assert_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
|
|
||||||
@@coll.find() { |cursor|
|
@@coll.find() { |cursor|
|
||||||
cursor.next_document
|
cursor.next_document
|
||||||
|
@ -368,8 +353,6 @@ class CursorTest < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_equal(client_cursors,
|
assert_equal(client_cursors,
|
||||||
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
@@db.command("cursorInfo" => 1)["clientCursors_size"])
|
||||||
assert_equal(by_location,
|
|
||||||
@@db.command("cursorInfo" => 1)["byLocation_size"])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_count_with_fields
|
def test_count_with_fields
|
||||||
|
|
Loading…
Reference in New Issue