Skip to content

fix(tests): stabilize durable function tag test - #1356

Closed
lucaspimentel wants to merge 2 commits into
mainfrom
lpimentel/fix-flaky-durable-tag-test
Closed

fix(tests): stabilize durable function tag test#1356
lucaspimentel wants to merge 2 commits into
mainfrom
lpimentel/fix-flaky-durable-tag-test

Conversation

@lucaspimentel

@lucaspimentel lucaspimentel commented Sep 3, 2026

Copy link
Copy Markdown
Member

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 -- --check
  • Focused test repeated 10 times: 10/10 passed
  • cargo nextest run lifecycle::invocation::processor: 53/53 passed
  • cargo nextest run --workspace: 650/650 passed

@lucaspimentel

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T21:42:30.424619Z 14a2bac Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: b49e2dbec6

ℹ️ 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".

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 3, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/datadog-lambda-extension | publish layer e2e sandbox (amd64, fips)

View more details · View in GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 55d6331 | Docs | View more details | Give us feedback!

@lucaspimentel lucaspimentel changed the title [APMSVLS-485] fix(tests): stabilize durable function tag test fix(tests): stabilize durable function tag test Sep 3, 2026
@lucaspimentel
lucaspimentel marked this pull request as ready for review September 3, 2026 20:28
@lucaspimentel
lucaspimentel requested a review from a team as a code owner September 3, 2026 20:28
@lucaspimentel
lucaspimentel requested review from duncanista and a lite review from Copilot September 3, 2026 20:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread bottlecap/src/lifecycle/invocation/processor.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 aggregator flush() and a search across all flushed sketches for the expected tags.
  • Asserts the invocation metric includes cold_start:true, durable_function:true, and the resolved runtime:{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.

@lucaspimentel
lucaspimentel marked this pull request as draft September 3, 2026 20:38
@lucaspimentel
lucaspimentel marked this pull request as ready for review September 3, 2026 21:40
@lucaspimentel
lucaspimentel force-pushed the lpimentel/fix-flaky-durable-tag-test branch from 14a2bac to ff0e69b Compare September 3, 2026 21:44
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.

🤖
@lucaspimentel
lucaspimentel force-pushed the lpimentel/fix-flaky-durable-tag-test branch from ff0e69b to 55d6331 Compare September 4, 2026 13:13
@lucaspimentel
lucaspimentel marked this pull request as draft September 4, 2026 16:45
@lucaspimentel

Copy link
Copy Markdown
Member Author

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

@lucaspimentel
lucaspimentel deleted the lpimentel/fix-flaky-durable-tag-test branch September 4, 2026 16:46
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