Skip to content

Clean up per-test DB paths after unit tests to avoid ENOSPC#14622

Open
xingbowang wants to merge 1 commit intofacebook:mainfrom
xingbowang:clean_up_unit_test_space
Open

Clean up per-test DB paths after unit tests to avoid ENOSPC#14622
xingbowang wants to merge 1 commit intofacebook:mainfrom
xingbowang:clean_up_unit_test_space

Conversation

@xingbowang
Copy link
Copy Markdown
Contributor

@xingbowang xingbowang commented Apr 15, 2026

Summary

When we migrated from one test one process model to sharding model, we didn't add db folder cleanup. This causes db folders to pile up in unit test. Add db folder clean up after each test completion on success. This keep the disk utilization low.

  • clean up paths registered through PerThreadDBPath() after each passing test so sharded unit-test runs do not accumulate leftover DB directories
  • keep failed-test artifacts when KEEP_DB is set or the test fails, while still resetting SyncPoint state between tests
  • add make check disk-usage diagnostics that report the largest per-test temp directories and DB-like directories on failure
  • add Python coverage for the diagnostics helper and C++ coverage for registered path cleanup

Test Plan

  • python3 build_tools/make_check_dbdir_report_test.py
  • make -j14 testutil_test
  • /usr/local/bin/timeout 60 ./testutil_test --gtest_filter="TestUtil.CleanupRegisteredPerTestPathsRemovesDirectory:TestUtil.CleanupRegisteredPerTestPathsRemovesFile"

@meta-cla meta-cla Bot added the CLA Signed label Apr 15, 2026
@github-actions
Copy link
Copy Markdown

⚠️ clang-tidy: 1 warning(s) on changed lines

Completed in 29.0s.

Summary by check

Check Count
concurrency-mt-unsafe 1
Total 1

Details

test_util/testharness.cc (1 warning(s))
test_util/testharness.cc:122:9: warning: function is not thread safe [concurrency-mt-unsafe]

@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 15, 2026

@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D101068798.

1 similar comment
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 15, 2026

@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D101068798.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant