diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-07-01 03:56:39 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-07-01 09:04:58 -0400 |
commit | f64357e485c8d46bd6fd393f7416df6117672de1 (patch) | |
tree | a90f2bb933dd4a1c2e774ac4e280e8ce7dbcbaeb /src/mongo/dbtests/profile_test.cpp | |
parent | e7e24a657b64fa59c30b063c72ff4cbee9674b7e (diff) | |
download | mongo-f64357e485c8d46bd6fd393f7416df6117672de1.tar.gz |
SERVER-13961 Add OperationContext argument to Client::Context
Time tracking and database access in Client::Context require access to the
OperationContext. Adding it as argument.
This is in preparation for removing LockState from Client.
Diffstat (limited to 'src/mongo/dbtests/profile_test.cpp')
-rw-r--r-- | src/mongo/dbtests/profile_test.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mongo/dbtests/profile_test.cpp b/src/mongo/dbtests/profile_test.cpp index b7a58b856d4..15e04854bf2 100644 --- a/src/mongo/dbtests/profile_test.cpp +++ b/src/mongo/dbtests/profile_test.cpp @@ -31,6 +31,7 @@ */ #include "mongo/db/instance.h" +#include "mongo/db/operation_context_impl.h" #include "mongo/unittest/unittest.h" using mongo::BSONObj; @@ -38,7 +39,8 @@ using mongo::DBDirectClient; using std::string; -namespace mongo_test { +namespace mongo { + class Profiler: public mongo::unittest::Test { public: static const string PROFILER_TEST_DB; @@ -48,11 +50,13 @@ namespace mongo_test { protected: void setUp() { BSONObj ret; + + OperationContextImpl txn; + DBDirectClient db(&txn); + db.runCommand(PROFILER_TEST_DB, BSON("dropDatabase" << 1), ret); ASSERT(ret["ok"].trueValue()); } - - DBDirectClient db; }; const string Profiler::PROFILER_TEST_DB = "profilerTestDB"; @@ -64,6 +68,9 @@ namespace mongo_test { // be profiled in a shortened version const string bigStr(16 * (1 << 20) - 200, 'a'); + OperationContextImpl txn; + DBDirectClient db(&txn); + { BSONObj replyObj; db.runCommand(PROFILER_TEST_DB, BSON("profile" << 2), replyObj); @@ -95,7 +102,8 @@ namespace mongo_test { builder.append(fieldName, x); } - DBDirectClient db; + OperationContextImpl txn; + DBDirectClient db(&txn); { BSONObj replyObj; |