Skip to content

test(urllib): increase est_value_delta in duration assertions to fix flaky test on PyPy - #5273

Open
VimalN2005 wants to merge 2 commits into
open-telemetry:mainfrom
VimalN2005:fix/urllib-flaky-metrics-test-delta
Open

VimalN2005 wants to merge 2 commits into
open-telemetry:mainfrom
VimalN2005:fix/urllib-flaky-metrics-test-delta

Conversation

@VimalN2005

Copy link
Copy Markdown

Description

Fixes #5180

In TestUrllibMetricsInstrumentation, assert_metric_expected uses est_value_delta=40 for duration metric comparisons. On PyPy environments and heavily loaded CI runners, the overhead of PyPy's JIT compilation and timer measurement jitter on the initial request often exceeds 40ms (for instance, recording 52.4ms while estimation measures higher), resulting in intermittent test failures in CI.

Align the duration estimation tolerance with other instrumentation tests in this repository (such as celery and tornado), which use est_value_delta=200 to reliably accommodate JIT warmup without sacrificing duration verification.

Type of change

  • Bug fix / test stabilization (non-breaking change which fixes an issue)

Checklist:

  • I am a human and not a bot
  • I have run relevant tests and linter locally
  • All checks pass

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-10-31 18:11 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

This branch has not been deployed

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Flaky urllib test on pypy

1 participant