summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/counttests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/dbtests/counttests.cpp')
-rw-r--r--src/mongo/dbtests/counttests.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/dbtests/counttests.cpp b/src/mongo/dbtests/counttests.cpp
index f8119b632a1..879d4353a0e 100644
--- a/src/mongo/dbtests/counttests.cpp
+++ b/src/mongo/dbtests/counttests.cpp
@@ -42,7 +42,7 @@ namespace CountTests {
class Base {
public:
- Base() : lk(_txn.lockState(), ns()), _context(&_txn, ns()) {
+ Base() : lk(_txn.lockState(), ns()), _wunit(_txn.recoveryUnit()), _context(&_txn, ns()) {
_database = _context.db();
_collection = _database->getCollection( &_txn, ns() );
if ( _collection ) {
@@ -55,6 +55,7 @@ namespace CountTests {
~Base() {
try {
uassertStatusOK( _database->dropCollection( &_txn, ns() ) );
+ _wunit.commit();
}
catch ( ... ) {
FAIL( "Exception while cleaning up collection" );
@@ -97,6 +98,7 @@ namespace CountTests {
private:
Lock::DBWrite lk;
+ WriteUnitOfWork _wunit;
Client::Context _context;