Percona Toolkit fix
General
Escalation
General
Escalation
Description
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.
Actual Result:
The Percona Toolkit test for stats is not passing. The
Query
property is unmarshalled intobson.D
instead ofbson.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:
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.Fix the
TestStats
and related tests:The
Query
property in the test data is likelybson.M
, while the target type isbson.D
. Adjust the test data or modify the unmarshalling logic.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.