Skip to content

chore: improve tower maintenance path#869

Open
oab24413gmai wants to merge 1 commit into
tower-rs:masterfrom
oab24413gmai:maint/20260521164556
Open

chore: improve tower maintenance path#869
oab24413gmai wants to merge 1 commit into
tower-rs:masterfrom
oab24413gmai:maint/20260521164556

Conversation

@oab24413gmai

Copy link
Copy Markdown

Summary:

  • Add unit tests for the Timeout middleware covering the elapsed-error branch: verify that when the inner future exceeds the configured duration, the service returns an Elapsed error (downcastable via the boxed error), and that requests completing before the deadline pass through unchanged. The timeout module files are small and self-contained; tests can be added inline with #[cfg(test)] using tokio::time::pause for deterministic timing.
  • Keep the change narrow so it is straightforward to review.

Notes:

  • I kept this scoped to the relevant implementation and tests.

@jlizen jlizen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to have some regression test coverage for the timeout layer, but let's update it to match the structure of other tests in tower/tests/<layer>/main.rs.

Those use tower_test::mock and tokio_test macros, check poll_ready, and various other things. I would expect the timeout tests to look very similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants