Skip to content

Commit 1fd7c10

Browse files
committed
test: ensure collection is created before testing since it is required for multi doc transaction
1 parent 79e0109 commit 1fd7c10

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/functional/bulk.test.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -2015,9 +2015,18 @@ describe('Bulk', function () {
20152015
client = config.newClient();
20162016
await client.connect();
20172017

2018-
collection = client
2018+
try {
2019+
await client
2020+
.db('bulk_operation_writes_test')
2021+
.collection('bulk_write_transaction_test')
2022+
.drop();
2023+
} catch (_) {
2024+
// do not care
2025+
}
2026+
2027+
collection = await client
20192028
.db('bulk_operation_writes_test')
2020-
.collection('bulk_write_transaction_test');
2029+
.createCollection('bulk_write_transaction_test');
20212030

20222031
await collection.deleteMany({});
20232032
});
@@ -2027,7 +2036,7 @@ describe('Bulk', function () {
20272036
async test() {
20282037
const session = client.startSession();
20292038
session.startTransaction({
2030-
readConcern: { level: 'snapshot' },
2039+
readConcern: { level: 'majority' },
20312040
writeConcern: { w: 'majority' }
20322041
});
20332042

@@ -2077,7 +2086,7 @@ describe('Bulk', function () {
20772086

20782087
await session.abortTransaction();
20792088
},
2080-
{ readConcern: { level: 'snapshot' }, writeConcern: { w: 'majority' } }
2089+
{ readConcern: { level: 'majority' }, writeConcern: { w: 'majority' } }
20812090
);
20822091

20832092
await session.endSession();

0 commit comments

Comments
 (0)