Percona Toolkit fix

Description

Actual Result:
The Percona Toolkit test for stats is not passing. The Query property is unmarshalled into bson.D instead of bson.M. Additionally, some structures and BSON tags are not consistently aligned, which can lead to incorrect or null data being unmarshalled.

Expected Result:
All tests should pass without being skipped. BSON tags should match the test data examples. Additionally, we should implement the ability to automatically generate test data when a specific environment variable is provided. Check for another inconsistencies.

Suggested Implementation:

  1. Verify locks properties in the SystemProfile struct:
    The BSON tag for R is inconsistent ("r" in some cases, "R" in others). Standardize the tag or adjust the test data accordingly.

  1. Fix the TestStats and related tests:
    The Query property in the test data is likely bson.M, while the target type is bson.D. Adjust the test data or modify the unmarshalling logic.

  2. Implement automatic test data regeneration:
    Introduce an environment variable that, when set, regenerates the expected test data dynamically.

This should ensure more reliable and maintainable tests.

Environment

None

Activity

Show:

Jiří Čtvrtka February 11, 2025 at 10:20 AM

Update on point 1:
Check “r” and “R” bson tags if they are used correctly:

  • "R" is used for write lock counts in the Collection.

  • "r" is used for read lock counts in Database, Global, and MMAPV1Journal.

Details

Assignee

Reporter

Priority

Fix versions

Needs QA

Yes

Smart Checklist

Created February 3, 2025 at 4:20 PM
Updated February 11, 2025 at 10:20 AM