Skip to content

Add lockInfo tests#612

Open
PatersonProjects wants to merge 3 commits into
documentdb:mainfrom
PatersonProjects:lockInfo_tests
Open

Add lockInfo tests#612
PatersonProjects wants to merge 3 commits into
documentdb:mainfrom
PatersonProjects:lockInfo_tests

Conversation

@PatersonProjects

Copy link
Copy Markdown
Contributor

This PR adds the tests for the lockInfo diagnostic command. Most of the tests are very straightforward, but response validation requires a lock in place to ensure fields can be checked and so is marked as no-parallel.

Ref: Issue #43, #443

Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…ks fields through use of fsynclock

Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
@PatersonProjects PatersonProjects requested a review from a team as a code owner June 16, 2026 18:19
@PatersonProjects PatersonProjects marked this pull request as draft June 16, 2026 18:20
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 16, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort M · Status In Progress
Confidence: 0.82 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (226+0 LOC, 5 files); LLM: Adds new test coverage for the $lockInfo diagnostic command, a functional enhancement to the test suite referencing tracked issues.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

@PatersonProjects PatersonProjects marked this pull request as ready for review June 16, 2026 19:04
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
@PatersonProjects PatersonProjects changed the title Add $lockInfo tests Add lockInfo tests Jun 24, 2026
pytestmark = pytest.mark.admin


CORE_BEHAVIOR_TESTS: list[DiagnosticTestCase] = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parametrized cases in test_lockInfo_core_behavior (returns_ok and returns_lockInfo_array) are identical to test_lockInfo_response_structure (ok_field and lockInfo_is_array). Consider removing the duplicates from one file — they belong in response_structure since they validate response shape.

pytestmark = pytest.mark.admin


ERROR_TESTS: list[DiagnosticTestCase] = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test for case-mismatched command name (e.g., {"LockInfo": 1} or {"LOCKINFO": 1}). The hostInfo PR includes such a test. Consider adding one for consistency.

assertProperties(result, {"ok": Eq(1.0)}, msg=spec.msg, raw_res=True)


INT_EDGE_TESTS: list[DiagnosticTestCase] = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the sibling ping PR (#616) which uses NUMERIC_EDGE_CASES covering -1, 0, and FLOAT_INFINITY, consider adding FLOAT_INFINITY here as well. Both commands ignore their value, and infinity is a special double value beyond what the BSON type acceptance test covers (3.14).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants