Skip to content

Commit 7e8d8f1

Browse files
committed
fix travis
1 parent beeaa30 commit 7e8d8f1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/mongocxx/test/client_session.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,10 @@ TEST_CASE("with_transaction", "[session]") {
765765

766766
session_test test;
767767

768+
if (!server_has_sessions(test.client)) {
769+
return;
770+
}
771+
768772
auto session = test.client.start_session();
769773

770774
// The following three tests are prose tests from the with_transaction spec.

src/mongocxx/test/database.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ using namespace mongocxx;
3838
using bsoncxx::builder::basic::kvp;
3939
using bsoncxx::builder::basic::make_array;
4040
using bsoncxx::builder::basic::make_document;
41+
using test_util::server_has_sessions;
4142

4243
bool check_for_collections(cursor cursor, std::set<std::string> expected_colls) {
4344
for (auto&& coll : cursor) {
@@ -341,6 +342,10 @@ TEST_CASE("Database integration tests", "[database]") {
341342
};
342343

343344
SECTION("listLocalSessions") {
345+
if (!server_has_sessions(mongo_client)) {
346+
return;
347+
}
348+
344349
auto session1 = mongo_client.start_session();
345350
auto session2 = mongo_client.start_session();
346351

0 commit comments

Comments
 (0)