Skip to content

Conversation

@anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Jun 4, 2025

If we use defer to fill Duration, it can be filled even when handler panics.

Also reworks tests to

  • Set name for running tests individually
  • Always return Metrics even if handler panics
  • Always runs assertions
  • Checks for nonzero duration for panic
  • Checks status/code / bytes written for panic case. No logic change to this here but it's good coverage I think.

Copy link
Owner

@felixge felixge left a comment

Choose a reason for hiding this comment

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

This is great, thank you both 🙇

@felixge felixge merged commit 9a9390b into felixge:master Jun 4, 2025
3 checks passed
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.

3 participants