Skip to content

CXX-3112 Sync spec tests from CXX-2808 #1245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

kevinAlbs
Copy link
Collaborator

Sync spec tests to fix test failures on 4.2 sharded tasks. Resolves CXX-3112.

Partially resolves CXX-2808. Not all updated spec tests are synced.

Verified with this patch build.

Details

Updating the C driver from 1.25.0 to 1.28.0 (as part of CXX-2828) resulted test failures on sharded cluster tasks on 4.2.

Example task failure:

/data/mci/cbb755e914c53d0b7523ef24f60ff28c/mongo-cxx-driver/src/mongocxx/test/spec/util.cpp:832: failed: explicitly with 6 messages: 'checking for path from environment variable: TRANSACTIONS_LEGACY_TESTS_PATH' and 'test path is: /data/mci/cbb755e914c53d0b7523ef24f60ff28c/mongo-cxx-driver/data/transactions/legacy' and 'Test path: /data/mci/cbb755e914c53d0b7523ef24f60ff28c/mongo-cxx-driver/data/transactions/legacy/error-labels.json' and 'Operation: { "name" : "commitTransaction", "object" : "session0", "result" : { "errorLabelsContain" : [ "RetryableWriteError", "UnknownTransactionCommitResult" ], "errorLabelsOmit" : [ "TransientTransactionError" ] } }' and 'apm_checker.print_all() := "
APM Checker contents:
APM event: { "command_started_event" : { "command" : { "insert" : "test", "ordered" : true, "$db" : "transaction-tests", "lsid" : { "id" : { "$binary" : "wxOGZK4HSkyDvHtv7CyRGQ==", "$type" : "04" } }, "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1727774851, "i" : 11 } }, "signature" : { "hash" : { "$binary" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "$type" : "00" }, "keyId" : 0 } }, "startTransaction" : true, "txnNumber" : 1, "autocommit" : false, "documents" : [ { "_id" : 1 } ] }, "command_name" : "insert", "operation_id" : 195740085, "database_name" : "transaction-tests" } }
APM event: { "command_started_event" : { "command" : { "commitTransaction" : 1, "$db" : "admin", "lsid" : { "id" : { "$binary" : "wxOGZK4HSkyDvHtv7CyRGQ==", "$type" : "04" } }, "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1727774851, "i" : 11 } }, "signature" : { "hash" : { "$binary" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "$type" : "00" }, "keyId" : 0 } }, "writeConcern" : { "w" : "majority" }, "txnNumber" : 1, "autocommit" : false }, "command_name" : "commitTransaction", "operation_id" : 195740086, "database_name" : "admin" } }
"' and 'Expected exception to contain the label 'RetryableWriteError' but it did not.

CDRIVER-4754 changed behavior for adding a RetryableWriteError in libmongoc. DRIVERS-2802 included follow-up spec test changes:

On versions of mongos prior to 4.3.1, those error labels may not be populated due to failCommand ignoring the errorLabels option used in the test.

This PR syncs some tests from DRIVERS-2802 to address the test failure.

Tests synced

Not all tests from DRIVERS-2802 were synced. The following tests are synced from mongodb/specifications@5fc23f4:

  • source/client-side-operations-timeout/*
    • Skipped. C++ driver does not-yet implement CSOT (CXX-2181).
  • source/command-logging-and-monitoring/tests/monitoring/writeConcernError.json
    • Skipped. Adding test is tracked in CXX-2633.
  • source/retryable-writes/tests/legacy/*
    • Skipped. C++ driver does not have a legacy retryable writes test runner. Legacy retryable writes tests have since been migrated to the unified test format. Tracked in CXX-2969.
  • source/retryable-writes/tests/unified/*
    • Synced.
  • source/transactions-convenient-api/tests/*
    • Synced.
  • source/transactions/tests/legacy/*
    • Synced.
  • source/unified-test-format/tests/valid-pass/poc-retryable-writes.json
    • Synced.

Sync from specifications commit 5fc23f40f79d18f0693e7159eba81f0e7b276715
Sync from specifications commit 5fc23f40f79d18f0693e7159eba81f0e7b276715
Sync from specifications commit 5fc23f40f79d18f0693e7159eba81f0e7b276715
Sync from specifications commit 5fc23f40f79d18f0693e7159eba81f0e7b276715
@kevinAlbs kevinAlbs requested review from adriandole and eramongodb and removed request for adriandole October 31, 2024 16:59
@kevinAlbs kevinAlbs merged commit 92811d2 into mongodb:master Nov 1, 2024
74 of 79 checks passed
eramongodb pushed a commit to eramongodb/mongo-cxx-driver that referenced this pull request Apr 8, 2025
Sync from specifications commit 5fc23f40f79d18f0693e7159eba81f0e7b276715
eramongodb added a commit that referenced this pull request Apr 8, 2025
Sync from specifications commit 5fc23f40f79d18f0693e7159eba81f0e7b276715

Co-authored-by: Kevin Albertson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants