Skip to content

Fix Flaky opentelemetry-sdk tests - #5415

Open
Eason09053360 wants to merge 3 commits into
open-telemetry:mainfrom
Eason09053360:fix-flaky-opentelemetry-sdk-tests
Open

Fix Flaky opentelemetry-sdk tests#5415
Eason09053360 wants to merge 3 commits into
open-telemetry:mainfrom
Eason09053360:fix-flaky-opentelemetry-sdk-tests

Conversation

@Eason09053360

@Eason09053360 Eason09053360 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Move ConcurrentMultiSpanProcessor.shutdown() before the mock call count
assertions in test_force_flush_late_by_timeout.

Waiting for shutdown before checking the call counts ensures that the
background work has completed and prevents the test from failing due to
thread scheduling.

Fixes #5393

Type of change

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

How Has This Been Tested?

The affected test was run using the Python 3.12 OpenTelemetry SDK tox
environment.

  • uv run tox -e py312-test-opentelemetry-sdk -- opentelemetry-sdk/tests/trace/test_span_processor.py -k test_force_flush_late_by_timeout -q

Result: 4 passed, 850 deselected.

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 14, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Eason09053360 / name: Eason Chen (e3e2770)

@Eason09053360
Eason09053360 force-pushed the fix-flaky-opentelemetry-sdk-tests branch from 98e1d1e to 28ca418 Compare July 14, 2026 10:06
@Eason09053360
Eason09053360 marked this pull request as ready for review July 14, 2026 11:39
@Eason09053360
Eason09053360 requested a review from a team as a code owner July 14, 2026 11:39
@Eason09053360
Eason09053360 marked this pull request as draft July 14, 2026 11:53
@Eason09053360
Eason09053360 force-pushed the fix-flaky-opentelemetry-sdk-tests branch from 28ca418 to e3e2770 Compare July 14, 2026 12:08
@Eason09053360
Eason09053360 marked this pull request as ready for review July 14, 2026 12:09
@Eason09053360

Copy link
Copy Markdown
Contributor Author

cc @xrmx

@Eason09053360
Eason09053360 force-pushed the fix-flaky-opentelemetry-sdk-tests branch from e3e2770 to e00e176 Compare July 18, 2026 05:55
Eason09053360 added a commit to Eason09053360/opentelemetry-python that referenced this pull request Jul 19, 2026
@Eason09053360
Eason09053360 force-pushed the fix-flaky-opentelemetry-sdk-tests branch from 8d1e471 to 6f7217a Compare July 24, 2026 08:40
@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

Flaky opentelemetry-sdk tests on windows / pypy-3.10

2 participants