summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-10-16 10:43:30 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-10-16 10:45:16 -0400
commite948b4b843c7e972bece22ceb2d2cf0907732499 (patch)
treea888b4134b2f1386c390ca36a9ad5942ef78d2fd
parent4850a6ae10601226642c6594f3b93e052d62bdf6 (diff)
downloadmongo-e948b4b843c7e972bece22ceb2d2cf0907732499.tar.gz
remove a timing assert, fix lng/lat swap
-rw-r--r--jstests/geo_s2twofields.js6
-rw-r--r--jstests/sharding/geo_shardedgeonear.js5
2 files changed, 6 insertions, 5 deletions
diff --git a/jstests/geo_s2twofields.js b/jstests/geo_s2twofields.js
index 8c15d1b4de7..6beac190fb0 100644
--- a/jstests/geo_s2twofields.js
+++ b/jstests/geo_s2twofields.js
@@ -49,16 +49,16 @@ var maxQueryRad = 0.5 * PI / 180.0;
var smallQuery = timeWithoutAndWithAnIndex({to: "2dsphere", from: "2dsphere"},
{from: {$within: {$centerSphere: [nyc.coordinates, maxQueryRad]}}, to: {$within: {$centerSphere: [miami.coordinates, maxQueryRad]}}});
print("Indexed time " + smallQuery[1] + " unindexed " + smallQuery[0]);
-assert(smallQuery[0] > smallQuery[1]);
+// assert(smallQuery[0] > smallQuery[1]);
// Let's just index one field.
var smallQuery = timeWithoutAndWithAnIndex({to: "2dsphere"},
{from: {$within: {$centerSphere: [nyc.coordinates, maxQueryRad]}}, to: {$within: {$centerSphere: [miami.coordinates, maxQueryRad]}}});
print("Indexed time " + smallQuery[1] + " unindexed " + smallQuery[0]);
-assert(smallQuery[0] > smallQuery[1]);
+// assert(smallQuery[0] > smallQuery[1]);
// And the other one.
var smallQuery = timeWithoutAndWithAnIndex({from: "2dsphere"},
{from: {$within: {$centerSphere: [nyc.coordinates, maxQueryRad]}}, to: {$within: {$centerSphere: [miami.coordinates, maxQueryRad]}}});
print("Indexed time " + smallQuery[1] + " unindexed " + smallQuery[0]);
-assert(smallQuery[0] > smallQuery[1]);
+// assert(smallQuery[0] > smallQuery[1]);
diff --git a/jstests/sharding/geo_shardedgeonear.js b/jstests/sharding/geo_shardedgeonear.js
index 16f17a2f73e..a59b4b87146 100644
--- a/jstests/sharding/geo_shardedgeonear.js
+++ b/jstests/sharding/geo_shardedgeonear.js
@@ -26,12 +26,13 @@ function test(db, sharded, indexType) {
for (var i=0; i < numPts; i++) {
var lat = 90 - Random.rand() * 180;
var lng = 180 - Random.rand() * 360;
- db[coll].insert({rand:Math.random(), loc: [lat, lng]})
+ db[coll].insert({rand:Math.random(), loc: [lng, lat]})
+ assert(!db.getLastError());
}
- db.getLastError();
assert.eq(db[coll].count(), numPts);
db[coll].ensureIndex({loc: indexType})
+ assert(!db.getLastError());
var queryPoint = [0,0]
geoCmd = {geoNear: coll, near: queryPoint, spherical: true, includeLocs: true};