Skip to content

Commit 4dc4677

Browse files
committed
Temporaraly skip live read concern tests
mongod doesn't currently enable this functionality by default
1 parent a8fe810 commit 4dc4677

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ as environment variables:
182182
URI-escape the username, for example write "user@realm" as "user%40realm".
183183
The user must be authorized to query `test.collection`.
184184

185+
MongoDB 3.2 adds support for readConcern, but does not enable support for
186+
read concern majority by default. mongod must be launched using
187+
`--enableMajorityReadConcern`.
188+
The test framework does not (and can't) automatically discover if this option was
189+
provided to MongoDB, so an additional variable must be set to enable these tests:
190+
191+
* `MONGOC_ENABLE_MAJORITY_READ_CONCERN`
192+
193+
Set this environment variable to `on` if MongoDB has enabled majority read concern.
194+
185195
All tests should pass before submitting a patch.
186196

187197
## Configuring the test runner

tests/test-mongoc-collection.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,8 +1428,14 @@ _test_count_read_concern_live (bool supports_read_concern)
14281428
mongoc_client_destroy (client);
14291429
}
14301430

1431+
int
1432+
mongod_supports_majority_read_concern (void)
1433+
{
1434+
return test_framework_getenv_bool ("MONGOC_ENABLE_MAJORITY_READ_CONCERN");
1435+
}
1436+
14311437
static void
1432-
test_count_read_concern_live (void)
1438+
test_count_read_concern_live (void *context)
14331439
{
14341440
if (test_framework_max_wire_version_at_least (WIRE_VERSION_READ_CONCERN)) {
14351441
_test_count_read_concern_live (true);
@@ -2890,7 +2896,7 @@ test_collection_install (TestSuite *suite)
28902896
TestSuite_Add (suite, "/Collection/count", test_count);
28912897
TestSuite_Add (suite, "/Collection/count_with_opts", test_count_with_opts);
28922898
TestSuite_Add (suite, "/Collection/count/read_concern", test_count_read_concern);
2893-
TestSuite_Add (suite, "/Collection/count/read_concern_live", test_count_read_concern_live);
2899+
TestSuite_AddFull (suite, "/Collection/count/read_concern_live", test_count_read_concern_live, NULL, NULL, mongod_supports_majority_read_concern);
28942900
TestSuite_Add (suite, "/Collection/drop", test_drop);
28952901
TestSuite_Add (suite, "/Collection/aggregate", test_aggregate);
28962902
TestSuite_Add (suite, "/Collection/aggregate/large", test_aggregate_large);

0 commit comments

Comments
 (0)