queue_retry test: measure retries from when each attempt started #25

Merged
jcoffey-dev merged 1 commits from fix/queue-retry-test into main 2026-09-23 04:21:38 +00:00
Owner

The server sets a deferred recipient's next retry from its clock when the
attempt defers, in whole seconds. The test subtracted its own clock taken
when the loop next saw the message, after saving and reporting, so
whenever that lag crossed a second boundary the 2 s retry measured 1 s
and the test failed. Under load, after the other SMTP tests, that was
most runs.

It now measures from when the test started the attempt, which the
server's deferral can only follow, by under a second: each retry is its
interval or one more. Each position is still checked against its own
interval, so a wrong schedule still fails.

Summary

Related issues

Upstream files

Clean room

Testing

The server sets a deferred recipient's next retry from its clock when the attempt defers, in whole seconds. The test subtracted its own clock taken when the loop next saw the message, after saving and reporting, so whenever that lag crossed a second boundary the 2 s retry measured 1 s and the test failed. Under load, after the other SMTP tests, that was most runs. It now measures from when the test started the attempt, which the server's deferral can only follow, by under a second: each retry is its interval or one more. Each position is still checked against its own interval, so a wrong schedule still fails. <!-- Thanks for contributing to INBUXA. CONTRIBUTING.md has the full guide; this is the short version. Delete any section that does not apply. --> ## Summary <!-- What changes, and why. The why is the part that is hard to recover later. --> ## Related issues <!-- e.g. Closes #123. Leave blank if there are none. --> ## Upstream files <!-- Does this touch files that came from Stalwart? If so: is the change as small as it can be, and is it marked with an `inbuxa:` comment saying which requirement it serves? Every edit to an upstream file is a conflict waiting at the next import, so it should be worth one. --> ## Clean room <!-- Only for changes to the rebuilt features in `crates/features`, or to the hooks that serve them. Confirm one: - [ ] I have not read Stalwart's Enterprise-licensed source, and worked from the specification in `docs/spec/features/`. - [ ] I have read it. (Say so -- the change will be reviewed with that in mind, or declined for the parts it touches. The project's claim of independent creation is a record, and the record has to be true.) --> ## Testing <!-- What you ran. `cargo test -p tests` covers what needs nothing but a store; say so if you ran any of the `#[ignore]`d suites from docs/spec/container-tests.md, and which. -->
jcoffey-dev added 1 commit 2026-09-23 04:13:13 +00:00
queue_retry test: measure retries from when each attempt started
ci / name-check (pull_request) Successful in 2m30s
ci / build (pull_request) Successful in 7m33s
86bf2432a2
The server sets a deferred recipient's next retry from its clock when the
attempt defers, in whole seconds. The test subtracted its own clock taken
when the loop next saw the message, after saving and reporting, so
whenever that lag crossed a second boundary the 2 s retry measured 1 s
and the test failed. Under load, after the other SMTP tests, that was
most runs.

It now measures from when the test started the attempt, which the
server's deferral can only follow, by under a second: each retry is its
interval or one more. Each position is still checked against its own
interval, so a wrong schedule still fails.
jcoffey-dev merged commit ce6882fe93 into main 2026-09-23 04:21:38 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#25