Skip to content

Speedup tests#7969

Merged
jenshnielsen merged 9 commits intomicrosoft:mainfrom
jenshnielsen:speedup_tests
Mar 26, 2026
Merged

Speedup tests#7969
jenshnielsen merged 9 commits intomicrosoft:mainfrom
jenshnielsen:speedup_tests

Conversation

@jenshnielsen
Copy link
Collaborator

No description provided.

@jenshnielsen jenshnielsen requested a review from a team as a code owner March 25, 2026 10:02
@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.97%. Comparing base (82b3c57) to head (d67fa0d).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
...strument_drivers/cryomagnetics/_cryomagnetics4g.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7969   +/-   ##
=======================================
  Coverage   69.97%   69.97%           
=======================================
  Files         333      333           
  Lines       32245    32247    +2     
=======================================
+ Hits        22562    22564    +2     
  Misses       9683     9683           

☔ 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.

jenshnielsen and others added 8 commits March 26, 2026 09:47
Add max_examples=10 to @settings for test_do1d_verify_shape,
test_do2d_verify_shape, test_dond_0d_verify_shape,
test_dond_1d_verify_shape, and test_dond_2d_verify_shape.

Without max_examples, hypothesis defaults to 100 examples, each running
a full measurement + DB write cycle. Also reduce n_points_pws max_value
from 500 to 50 since these tests verify shapes, not data integrity at
scale.

Reduces each parametrized variant from ~16-18s to ~1.2s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- test_datasaver_2d: add max_examples=10, reduce n_points max 50 -> 15
- test_datasaver_unsized_arrays: reduce N max_value from 500 to 50
- test_cache_2d, test_cache_2d_shape: reduce max_examples from 10 to 5

These tests perform per-iteration DB flush + cache validation, making
each hypothesis example expensive. Reducing examples and parameter
ranges maintains coverage while cutting runtime significantly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The wait_while_ramping method has a hardcoded 20s
stability_check_interval. The test was waiting the full 20s for the
timeout to trigger. Mock time.time() to simulate 21s elapsing
instantly, reducing runtime from ~20s to <1s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add max_examples=10 and reduce n_points_pws max_value from 1000 to 50.
Without max_examples, hypothesis defaults to 100 examples each running
a full do0d() measurement cycle with up to 1000-point setpoints.

Reduces each parametrized variant from ~14-16s to ~1.2s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reduce max_examples from 25 to 10, outer_len max from 100 to 20, and
inner_len max from 1000 to 200. The worst case was 100 outer iterations
× 1000-element arrays × 2 datasets × 25 examples, creating millions of
array operations per test run.

Reduces from ~17s to ~2s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- test_datasaver_1d: add max_examples=10, reduce n_points max 100 -> 50
- test_datasaver_arrays_of_different_length: add max_examples=10
  (was default 100)
- test_datasaver_array_parameters_channel (2 files): reduce N max
  500 -> 100
- test_datasaver_array_parameters_array: reduce N max 500 -> 100
- test_cache_1d: reduce max_examples from 10 to 5 (16 parametrize
  combos make this inherently expensive)

All tests verify correctness of data shapes and storage, not
performance at scale. Reduced ranges still provide good coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jenshnielsen jenshnielsen added this pull request to the merge queue Mar 26, 2026
Merged via the queue into microsoft:main with commit a41a0ad Mar 26, 2026
18 checks passed
@jenshnielsen jenshnielsen deleted the speedup_tests branch March 26, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants