Repository navigation
test(agent): a certificate report may fill its budget exactly - #398
Conversation
Within keeps readings while they fit, the last byte included, and the caller's 64-byte margin keeps such a report under the gateway's bound. The test refused a report equal to the budget, which happens when the timestamps encode to just the right size (CI run 44890781278). Signed-off-by: samuel mbabhazi <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
What
TestWithinKeepsTheInventoryAndTheSoonestExpiriesnow accepts a report whose size equals the budget given tocertwatch.Within. It still refuses one that goes over.Why
CI run 44890781278 failed on an unrelated PR (#395) with a report of exactly 61 376 bytes, the budget of 60 KiB minus 64.
Withinkeeps readings while they fit, the last byte included. The agent gives itMaxReportBytes - 64 - size, and the gateway sends a report belowMaxReportBytes, so the equal case is valid. The assertion used>=. Whether a run hits the exact size depends on how thetime.Now()timestamps encode, which made the test fail now and then.How it was tested
The test passes 50 times in a row with
-race, and golangci-lint reports no issue.Security considerations
Test only. The report bound is unchanged.
Summary by CodeRabbit