Skip to content

Fix thread cleanup in prompt tests#19313

Merged
harupy merged 2 commits intomlflow:masterfrom
harupy:fix-prompt-test-thread-cleanup
Dec 10, 2025
Merged

Fix thread cleanup in prompt tests#19313
harupy merged 2 commits intomlflow:masterfrom
harupy:fix-prompt-test-thread-cleanup

Conversation

@harupy
Copy link
Member

@harupy harupy commented Dec 10, 2025

Related Issues/PRs

#xxx

What changes are proposed in this pull request?

  • Add timeout to thread join in test fixture to prevent tests from hanging indefinitely
  • Update thread prefixes in cleanup fixture to match current thread naming conventions

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

🤖 Generated with Claude Code

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 10, 2025 08:23
@github-actions
Copy link
Contributor

@harupy Thank you for the contribution! Could you fix the following issue(s)?

⚠ Invalid PR template

This PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out.

@github-actions github-actions bot added area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs. labels Dec 10, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves test reliability by preventing tests from hanging indefinitely due to background threads that don't complete. The changes add timeout handling to thread cleanup and update the list of thread prefixes to match current background threading patterns.

  • Adds a 5-second timeout to thread joins with TimeoutError raising to catch threads that don't complete
  • Refactors thread prefix cleanup from separate calls to a loop-based approach
  • Adds "link_prompts_from_exporter" to the list of thread prefixes to clean up (matching the thread naming pattern introduced in mlflow/tracing/export/utils.py)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@harupy harupy requested a review from kriscon-db December 10, 2025 08:30
Copy link
Collaborator

@kriscon-db kriscon-db left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. Not really sure why the unrelated test was impacted but this class of error can be tricky to reason about.

@harupy harupy merged commit 0f486e5 into mlflow:master Dec 10, 2025
41 of 45 checks passed
@harupy harupy deleted the fix-prompt-test-thread-cleanup branch December 10, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants