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

Improved test execution #2482

Merged
merged 3 commits into from
Sep 1, 2023
Merged

Improved test execution #2482

merged 3 commits into from
Sep 1, 2023

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented Jul 14, 2023

🚀 🚀 Pull Request

Changes

Making tests pass consistently and easier to troubleshoot when they don't.

  • Marked slow tests with pytest.mark.slow to make it easier to run the full suite consistently by skipping the slow tests. The fast tests run first on the build system for quicker feedback on failures
  • Disabled lock usage in general for tests as they seemed to cause lock-ups
  • Found the tests that seem to cause deadlocks and marked them with pytest.mark.flaky and moved them to a separate build step
  • Disabled tqdm.interval-monitor in tests since it seemed to cause deadlocks
  • Ran tests under the profiler and store the results in the test-result artifacts
  • Made the test results quieter for easier-to-read github logs, full results will be in the test-result artifacts
  • Separated local+hub from other storage tests to allow parallel test execution for faster overall test speed

I didn't do a lot with the overall code performance, but I addressed these two issues:

  • The posixpath.relpath() call is surprisingly slow and called a ton, so I added a simple caching around that since the computation should be consistent for our use
  • The way I'd run tests would cause test_dataset to be recreated/re-downloaded in several locations, so I made it always be created in the repo root

There was also a couple previously-failing (and maybe newly failing?) tests I fixed.

Other PRs that go along with this:

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Test Results

       21 files         21 suites   11h 35m 16s ⏱️
  1 503 tests   1 397 ✔️    101 💤 4  1 🔥
14 505 runs  10 159 ✔️ 4 339 💤 6  1 🔥

For more details on these failures and errors, see this check.

Results for commit 7ef986a.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Patch coverage: 95.41% and project coverage change: -0.91% ⚠️

Comparison is base (8771ce5) 84.81% compared to head (86e09b9) 83.90%.
Report is 16 commits behind head on main.

❗ Current head 86e09b9 differs from pull request most recent head ed41837. Consider uploading reports for the commit ed41837 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2482      +/-   ##
==========================================
- Coverage   84.81%   83.90%   -0.91%     
==========================================
  Files         330      224     -106     
  Lines       39474    24374   -15100     
==========================================
- Hits        33481    20452   -13029     
+ Misses       5993     3922    -2071     
Flag Coverage Δ
unittests 83.90% <95.41%> (-0.91%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
deeplake/auto/unstructured/yolo/yolo.py 91.12% <ø> (-0.81%) ⬇️
deeplake/tests/client_fixtures.py 85.71% <66.66%> (+2.38%) ⬆️
deeplake/tests/path_fixtures.py 91.42% <78.94%> (+4.07%) ⬆️
deeplake/core/dataset/dataset.py 92.84% <100.00%> (+0.97%) ⬆️
deeplake/core/lock.py 86.05% <100.00%> (+0.26%) ⬆️
deeplake/core/meta/dataset_meta.py 100.00% <100.00%> (ø)
deeplake/core/storage/azure.py 83.01% <100.00%> (-0.40%) ⬇️
deeplake/core/storage/gcs.py 67.82% <100.00%> (-2.32%) ⬇️
deeplake/core/storage/local.py 93.33% <100.00%> (+0.05%) ⬆️
deeplake/core/storage/s3.py 64.34% <100.00%> (+0.90%) ⬆️
... and 8 more

... and 160 files with indirect coverage changes

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

@artgish artgish added quick-tests Run DeepLake quick tests test-macos Trigger MacOS tests full-tests Trigger Full versioned OS tests and removed quick-tests Run DeepLake quick tests labels Jul 22, 2023
@nvoxland nvoxland force-pushed the identify_slow_tests branch 2 times, most recently from b800333 to c4b8bff Compare August 23, 2023 05:41
@nvoxland nvoxland changed the title Identify slow tests Improved test execution Aug 23, 2023
deeplake/core/seed.py Outdated Show resolved Hide resolved
- Introduced flaky test marker
- Fixed failing tests
- Disable locks in tests
- Disabled tqdm.interval-monitor in tests
- Improved test github action
- Introduced caching around posixpath.relpath() as it caused a surprising slowdown in tests
- Ensure `test_dataset` is always in a consistent location
- Moved some tests to use local datastore vs. hub-cloud
@sonarcloud
Copy link

sonarcloud bot commented Aug 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 12 Code Smells

18.0% 18.0% Coverage
2.5% 2.5% Duplication

# Conflicts:
#	deeplake/core/vectorstore/test_deeplake_vectorstore.py
#	deeplake/enterprise/test_pytorch.py
@nvoxland nvoxland merged commit b289139 into main Sep 1, 2023
1 check passed
@nvoxland nvoxland deleted the identify_slow_tests branch September 1, 2023 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-tests Trigger Full versioned OS tests quick-tests Run DeepLake quick tests test-macos Trigger MacOS tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants