Skip to content

Optimize tests/tracing/test_otel_loading.py with cached database#19165

Merged
harupy merged 2 commits intomlflow:masterfrom
harupy:optimize-test-otel-loading
Dec 3, 2025
Merged

Optimize tests/tracing/test_otel_loading.py with cached database#19165
harupy merged 2 commits intomlflow:masterfrom
harupy:optimize-test-otel-loading

Conversation

@harupy
Copy link
Member

@harupy harupy commented Dec 2, 2025

Related Issues/PRs

N/A

What changes are proposed in this pull request?

Optimize tests/tracing/test_otel_loading.py by:

  • Using a cached SQLite database (module-scoped fixture) to avoid repeated migrations for each test run
  • Using ServerThread instead of _init_server for a lighter-weight in-process server

This follows the same pattern used in tests/tracking/test_model_registry.py.

Before (baseline)

Run 19860816858

Job Duration Tests Min Max Avg
windows (1) 148.31s 10 13.896s 16.704s 14.831s
windows (2) 107.39s 9 7.647s 14.731s 11.933s
windows (3) 97.41s 9 7.178s 13.475s 10.824s
windows (4) 105.23s 9 10.371s 15.639s 11.692s

After (optimized)

Run 19862282787

Job Duration Tests Min Max Avg
windows (1) 12.60s 10 0.776s 4.620s 1.260s
windows (2) 13.44s 9 0.789s 6.387s 1.494s
windows (3) 12.06s 9 0.664s 5.199s 1.340s
windows (4) 13.81s 9 0.778s 4.096s 1.534s

Comparison

Job Before After Speedup
windows (1) 148.31s 12.60s 11.8x
windows (2) 107.39s 13.44s 8.0x
windows (3) 97.41s 12.06s 8.1x
windows (4) 105.23s 13.81s 7.6x

How is this PR tested?

  • Existing unit/integration tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.

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

Components

  • area/build: Build and test infrastructure for MLflow

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

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>
@github-actions github-actions bot added area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs. labels Dec 2, 2025
@mlflow mlflow deleted a comment from github-actions bot Dec 2, 2025
@harupy harupy changed the title Optimize tests/tracing/test_otel_loading.py with cached database Optimize tests/tracing/test_otel_loading.py with cached database Dec 2, 2025
@harupy harupy requested a review from serena-ruan December 2, 2025 15:27
Copy link
Collaborator

@serena-ruan serena-ruan left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks :)

@harupy harupy enabled auto-merge December 3, 2025 03:47
@harupy harupy added this pull request to the merge queue Dec 3, 2025
Merged via the queue into mlflow:master with commit 8911c37 Dec 3, 2025
43 of 45 checks passed
@harupy harupy deleted the optimize-test-otel-loading branch December 3, 2025 03:53
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.

2 participants