Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Both features only wrk starting on 2.6
technically speaking, 2.5.5 for the Hint feature
  • Loading branch information
fmpwizard committed Jul 3, 2017
commit f84c737b2838e6ea440681287426c61d3c9814cf
2 changes: 1 addition & 1 deletion harness/daemons/.env
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ COMMONSOPTS="

if versionAtLeast 3 2; then
# 3.2 doesn't like --nojournal on config servers.
COMMONCOPTS="$(echo "$COMMONCOPTS" | sed '/--nojournal/d')"
#COMMONCOPTS="$(echo "$COMMONCOPTS" | sed '/--nojournal/d')"
# Using a hacked version of MongoDB 3.2 for now.

# Go back to MMAPv1 so it's not super sluggish. :-(
Expand Down
10 changes: 9 additions & 1 deletion session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,10 @@ func (s *S) TestCountSkipLimit(c *C) {
}

func (s *S) TestCountMaxTimeMS(c *C) {
if !s.versionAtLeast(2, 6) {
c.Skip("SetMaxTime only supported in 2.6+")
}

session, err := mgo.Dial("localhost:40001")
c.Assert(err, IsNil)
defer session.Close()
Expand All @@ -1203,15 +1207,19 @@ func (s *S) TestCountMaxTimeMS(c *C) {
e := err.(*mgo.QueryError)
// We hope this query took longer than 1 ms, which triggers an error code 50
c.Assert(e.Code, Equals, 50)

}

func (s *S) TestCountHint(c *C) {
if !s.versionAtLeast(2, 6) {
c.Skip("Not implemented until mongo 2.5.5 https://jira.mongodb.org/browse/SERVER-2677")
}

session, err := mgo.Dial("localhost:40001")
c.Assert(err, IsNil)
defer session.Close()

coll := session.DB("mydb").C("mycoll")

err = coll.Insert(M{"n": 1})
c.Assert(err, IsNil)

Expand Down