-
Notifications
You must be signed in to change notification settings - Fork 310
feat: Add litestream-test harness for comprehensive database testing #748
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c526be1
to
3744986
Compare
- Implement populate command for quickly creating test databases - Add load command for generating continuous read/write workloads - Create validate command for integrity and checksum verification - Add shrink command for testing database shrinking scenarios - Support configurable page sizes, write patterns, and validation modes - Handle databases crossing 1GB boundary (SQLite lock page edge case) Part of comprehensive testing framework for validating Litestream behavior with large databases, various write patterns, and edge cases.
- Move all test scripts to cmd/litestream-test/scripts/ directory - Create comprehensive README.md documenting all test scripts - Move test results documentation to .local/test-results/ (gitignored) - Clean up root directory test artifacts Test scripts include: - reproduce-critical-bug.sh: Reproduces checkpoint during downtime bug - test-1gb-boundary.sh: Tests SQLite 1GB lock page handling - test-fresh-start.sh: Tests fresh database creation workflow - test-rapid-checkpoints.sh: Stress tests rapid checkpoint cycling - test-wal-growth.sh: Tests 100MB+ WAL file handling - test-concurrent-operations.sh: Tests 5 concurrent database replications - verify-test-setup.sh: Ensures local builds are used 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…entation - Add S3 LTX file retention cleanup testing scripts: - test-s3-retention-small-db.sh: Tests 50MB database with 2min retention - test-s3-retention-large-db.sh: Tests 1.5GB database crossing SQLite lock page - test-s3-retention-comprehensive.sh: Master script with comparative analysis - S3-RETENTION-TESTING.md: Complete documentation and usage guide - Scripts use local Python S3 mock for isolated testing - Validate Ben's concern about LTX file cleanup after retention period - Include critical SQLite 1GB lock page boundary testing - Update scripts/README.md with new S3 retention test documentation - Clean up temporary markdown files and analysis artifacts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Disable MD031 (blanks-around-fences) and MD032 (blanks-around-lists) - Fix README.md heading style to use consistent setext format - Convert bold text to proper headings in S3-RETENTION-TESTING.md - Add required blank lines around headings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
a92760a
to
b817367
Compare
Add four new testing scripts for automated validation: - analyze-test-results.sh: Parse and analyze test output logs - test-overnight-s3.sh: Extended S3 replication stress testing - test-overnight.sh: General overnight stress testing suite - test-quick-validation.sh: Fast validation for common scenarios These scripts provide comprehensive test coverage for replication, retention, and recovery scenarios across different storage backends. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Populate database before starting litestream to ensure data exists - Adjust aggressive test parameters for shorter test duration - Improve monitoring with WAL size tracking and replica metrics - Fix table detection for accurate row counting - Better error filtering to exclude non-critical warnings - Enhanced summary with clearer success/failure indicators 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive testing harness (
litestream-test
) for validating Litestream's behavior with large databases, various write patterns, and edge cases. This is the first implementation based on discussions with @benbjohnson about the need for thorough testing, particularly for databases larger than 1GB and various operational scenarios.Background
Based on requirements outlined in [internal planning documents], we need comprehensive testing for:
Implementation
New Binary:
/cmd/litestream-test/
Four primary commands implemented:
populate
- Quickly create test databases to target sizesload
- Generate continuous workload on databasesvalidate
- Verify replication integrityshrink
- Test database shrinking scenariosTesting
Comprehensive testing was performed using the demo script available here:
Test Harness Demo Script (Gist)
Test Results
✅ Database Creation
✅ Write Patterns
✅ Page Size Configuration
✅ Shrink Operations
Example Usage
Key Features
Next Steps
This is the first pass of the testing framework. Future enhancements could include:
Notes
cc: @benbjohnson @corylanou