summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/cppsuite/test_harness/test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/test/cppsuite/test_harness/test.cxx')
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/test_harness/test.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/test/cppsuite/test_harness/test.cxx b/src/third_party/wiredtiger/test/cppsuite/test_harness/test.cxx
index 4ce0de2e381..8cdea3170df 100644
--- a/src/third_party/wiredtiger/test/cppsuite/test_harness/test.cxx
+++ b/src/third_party/wiredtiger/test/cppsuite/test_harness/test.cxx
@@ -119,8 +119,12 @@ test::run()
/* Add the user supplied wiredtiger open config. */
db_create_config += _args.wt_open_config;
- /* Set up the test environment. */
- connection_manager::instance().create(db_create_config);
+ /*
+ * Set up the test environment. A smart pointer is used here so that the connection can
+ * automatically be closed by the scoped_connection's destructor when the test finishes and the
+ * pointer goes out of scope.
+ */
+ _scoped_conn = std::make_shared<scoped_connection>(db_create_config);
/* Initiate the load stage of each component. */
for (const auto &it : _components)