Skip to content

Fix flaky test that tests lots of threads calling emit. Make sure tests shutdown the batch exporter.#4600

Merged
xrmx merged 6 commits intoopen-telemetry:mainfrom
DylanRussell:fix_broken_test_and_shutdown_threads
May 27, 2025
Merged

Fix flaky test that tests lots of threads calling emit. Make sure tests shutdown the batch exporter.#4600
xrmx merged 6 commits intoopen-telemetry:mainfrom
DylanRussell:fix_broken_test_and_shutdown_threads

Conversation

@DylanRussell
Copy link
Contributor

Description

Fixes the BachProcessor.test_with_multiple_threads test which wasn't setup properly and was failing often.

Updates all tests using the BatchProcessor to call shutdown before the test ends. Otherwise the worker thread that gets spawned continues to run after the test ends.

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

This is just a change to improve the unit tests.

Does This PR Require a Contrib Repo Change?

No

Checklist:

  • [x ] Followed the style guidelines of this project
  • [N/A ] Changelogs have been updated
  • [x ] Unit tests have been added
  • [x ] Documentation has been updated

@DylanRussell DylanRussell requested a review from a team as a code owner May 23, 2025 16:18
@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 27, 2025
@xrmx xrmx enabled auto-merge (squash) May 27, 2025 15:59
@xrmx xrmx merged commit 12bcd45 into open-telemetry:main May 27, 2025
353 checks passed
JWinermaSplunk pushed a commit to JWinermaSplunk/opentelemetry-python that referenced this pull request Feb 17, 2026
…ts shutdown the batch exporter. (open-telemetry#4600)

* Initital commit to imporve shutdown behavior.

* Remove print statements and changes from shutdown branch

* Remove unused imports/deps

* fix lint issue

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
JWinermaSplunk pushed a commit to JWinermaSplunk/opentelemetry-python that referenced this pull request Feb 17, 2026
…ts shutdown the batch exporter. (open-telemetry#4600)

* Initital commit to imporve shutdown behavior.

* Remove print statements and changes from shutdown branch

* Remove unused imports/deps

* fix lint issue

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants