Add lockInfo tests#612
Conversation
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…ks fields through use of fsynclock Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent 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 |
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
| pytestmark = pytest.mark.admin | ||
|
|
||
|
|
||
| CORE_BEHAVIOR_TESTS: list[DiagnosticTestCase] = [ |
There was a problem hiding this comment.
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] = [ |
There was a problem hiding this comment.
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] = [ |
There was a problem hiding this comment.
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).
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