Loading
fix: add acceptance tests for slowlogs.Recorder
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do?
This MR adds acceptance tests for the slowlogs.Recorder component as requested in issue #1141 (closed) . The tests verify that:
- Proper recording of timing data for slow requests
- Correct logging of nested recorder calls with appropriate timing values
- No logging occurs for requests faster than the threshold
The tests are designed to fail if new recorder calls are added without updating the tests, as requested in the original issue.
Related issues
Closes #1141 (closed)
Implementation details
Added two test cases in the acceptance test package:
-
TestSlowlogsRecorderIntegration- Tests slow requests that exceed the threshold -
TestSlowlogsRecorderWithFastRequest- Tests fast requests that don't trigger logging
The tests simulate real-world usage patterns of the recorder in the codebase by creating nested function calls with multiple recorders, similar to how they're used in ``internal/vfs/serving/serving.go`.
MR acceptance checklist
-
Tests pass
Edited by Naman Jagdish Gala