Skip to content

test(logger): make sample-rate assertions independent of log order - #6014

Merged
svozza merged 2 commits into
mainfrom
fix/logger-sampling-log-order
Nov 19, 2026
Merged

svozza merged 2 commits into
mainfrom
fix/logger-sampling-log-order

Conversation

@svozza

@svozza svozza commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Summary

The Logger sample-rate e2e test could fail when a sampled invocation emitted all four expected application logs but the sampling diagnostic appeared after the first record. The assertion now checks the application messages in any order.

Changes

  • Verify that sampled invocations emit the fixture message exactly once at each of DEBUG, INFO, WARN, and ERROR, and that unsampled invocations emit it once at ERROR.
  • Match the optional fifth record by its DEBUG level and diagnostic message. Explain why cold-start sampling emits it during initialization and warm-start sampling emits it during the invocation.

Issue number: closes #6013


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@svozza
svozza merged commit 613461c into main Nov 19, 2026
45 checks passed
@svozza
svozza deleted the fix/logger-sampling-log-order branch November 19, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintenance: Make the Logger sample-rate e2e test independent of log order

2 participants