fix(tests): stabilize durable function tag test - #1356
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14a2bacf11
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🟢 Approval recommended
The change is test-only, directly addresses the described flakiness mechanism, and the updated assertion is consistent with how metrics are flushed and structured.
Pull request overview
Stabilizes a flaky lifecycle invocation test around durable function tagging by avoiding assumptions about which 10-second aggregation bucket the invocation metric lands in while on_invoke_event is executing.
Changes:
- Replaces wall-clock sampling + bucket rounding +
get_entry_by_id(...)with an aggregatorflush()and a search across all flushed sketches for the expected tags. - Asserts the invocation metric includes
cold_start:true,durable_function:true, and the resolvedruntime:{runtime}tag without relying on a single computed timestamp.
File summaries
| File | Description |
|---|---|
| bottlecap/src/lifecycle/invocation/processor.rs | Updates the durable-function invocation metric unit test to validate tags by scanning flushed aggregation output rather than guessing the aggregation bucket timestamp. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
14a2bac to
ff0e69b
Compare
Assert against the flushed metrics instead of guessing which timestamp bucket the invocation metric landed in, so the test cannot fail on a clock step. 🤖
ff0e69b to
55d6331
Compare
|
the chance of it happening is extremely small (it has never happened since the test was added), so I'm closing the PR for now |
Overview
Stabilize the durable function invocation metric test by flushing the metrics aggregator and searching the returned sketches for the invocation metric and its expected tags.
This avoids guessing which 10-second aggregation bucket contains the metric when the wall clock crosses a bucket boundary. There is no production code change.
Testing
cargo fmt --all -- --checkcargo nextest run lifecycle::invocation::processor: 53/53 passedcargo nextest run --workspace: 650/650 passed