summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/test_harness_helper.h
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2018-11-01 18:51:15 -0400
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2018-11-08 18:35:00 -0500
commitaff889b39301472bd2143967938a3dba468dfc63 (patch)
tree2ee4fcec926d96a674690e390d5b916b4b9c7a3b /src/mongo/db/storage/test_harness_helper.h
parent4fb38d9c10123321dada6fe1be477f9cb99732a7 (diff)
downloadmongo-aff889b39301472bd2143967938a3dba468dfc63.tar.gz
SERVER-36473 Make a dedicated RAII class to manage Client lifetime
Diffstat (limited to 'src/mongo/db/storage/test_harness_helper.h')
-rw-r--r--src/mongo/db/storage/test_harness_helper.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/db/storage/test_harness_helper.h b/src/mongo/db/storage/test_harness_helper.h
index c5c5216b4b6..fe0c2fa0a8f 100644
--- a/src/mongo/db/storage/test_harness_helper.h
+++ b/src/mongo/db/storage/test_harness_helper.h
@@ -38,6 +38,7 @@
#include "mongo/db/operation_context_noop.h"
#include "mongo/db/record_id.h"
#include "mongo/db/service_context.h"
+#include "mongo/db/service_context_test_fixture.h"
#include "mongo/db/storage/sorted_data_interface.h"
#include "mongo/stdx/functional.h"
#include "mongo/stdx/memory.h"
@@ -53,10 +54,9 @@ namespace mongo {
* HarnessHelper implementation. The newRecoveryUnit() implementation dictates what RecoveryUnit
* implementation the OperationContext has.
*/
-class HarnessHelper {
+class HarnessHelper : public ScopedGlobalServiceContextForTest {
public:
- virtual ~HarnessHelper();
-
+ virtual ~HarnessHelper() = default;
explicit HarnessHelper();
virtual ServiceContext::UniqueOperationContext newOperationContext(Client* const client) {
@@ -83,6 +83,9 @@ public:
}
virtual std::unique_ptr<RecoveryUnit> newRecoveryUnit() = 0;
+
+protected:
+ ThreadClient _threadClient;
};
namespace harness_helper_detail {