Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add POLARS_TIMEOUT_MS for timing out slow Polars tests #21887

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

orlp
Copy link
Collaborator

@orlp orlp commented Mar 21, 2025

This adds the environment variable POLARS_TIMEOUT_MS that when set will cause any call to any Polars function automatically exit the process with an error if the function still isn't finished after that many milliseconds has passed. This is useful for figuring out with pytest which test is hanging, if any.

I've also turned it on in the CI and Makefile when testing, defaulting to 60 seconds. This may need to be raised, we'll see.

If the environment variable POLARS_TIMEOUT_MS is not set when the first call to a Polars function is made, the mechanic is disabled entirely for performance.

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars labels Mar 21, 2025
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 90.16393% with 6 lines in your changes missing coverage. Please review.

Project coverage is 80.92%. Comparing base (4fd8d57) to head (923198e).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-python/src/timeout.rs 89.83% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21887      +/-   ##
==========================================
- Coverage   80.93%   80.92%   -0.01%     
==========================================
  Files        1624     1625       +1     
  Lines      234643   234704      +61     
  Branches     2693     2693              
==========================================
+ Hits       189899   189929      +30     
- Misses      44110    44141      +31     
  Partials      634      634              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@orlp orlp enabled auto-merge (squash) March 21, 2025 15:29
@orlp orlp disabled auto-merge March 21, 2025 15:29
@orlp orlp merged commit d95e343 into pola-rs:main Mar 21, 2025
30 checks passed
jsjasonseba pushed a commit to jsjasonseba/polars that referenced this pull request Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant