-
Notifications
You must be signed in to change notification settings - Fork 310
Improve test scripts with comprehensive validation and MinIO S3 testing #763
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
base: main
Are you sure you want to change the base?
Conversation
- Add new test-comprehensive.sh script for thorough testing with aggressive intervals - Fix table detection to handle multiple table naming patterns (load_test, test_table_0, test_data) - Fix operation counting with correct grep patterns for compactions and checkpoints - Fix file counting for file replicas (use .ltx not .lz4 files) - Improve error handling to exclude known non-critical errors - Add comprehensive final statistics reporting to all scripts - Ensure database population happens before litestream starts to avoid lock conflicts - Add monitoring for WAL size, sync counts, and operation deltas Per Ben's requirements: - Aggressive compaction intervals: 30s/1m/5m - Snapshot intervals: 10m for comprehensive testing - Heavy load generation (500 writes/sec) to trigger checkpoints - Support for long-running tests (2+ hours)
- Use default values for uninitialized variables in delta calculations - Prevents 'syntax error in expression' when variables are not yet set
- Force grep count results to be integers using arithmetic expansion - Remove dependency on default values since variables are initialized - Ensures clean integer arithmetic without newline issues
- Remove '|| echo' pattern that was causing double output - Use parameter expansion to set default value of 0 if empty - Prevents '0\n0' from being passed to arithmetic expansion
- Uses Docker to run MinIO locally for S3-compatible testing - Uses ports 9100/9101 to avoid conflicts with common services - Automatically creates bucket and configures Litestream - Tests real S3 semantics including snapshots and WAL segments - Includes restoration testing from S3 - Monitors MinIO object counts during test run
- Count LTX files instead of WAL files (S3 uses LTX format) - Fix restoration command syntax (use config file) - Display LTX segment counts in monitoring
scripts/test-comprehensive.sh
Outdated
# Aggressive settings per Ben's request | ||
snapshot-interval: 10m # Snapshots every 10 minutes | ||
retention: 1h # Keep data for 1 hour | ||
retention-check-interval: 5m # Check retention every 5 minutes | ||
|
||
# Aggressive compaction: 30s/1m/5m intervals | ||
compaction: | ||
- duration: 30s | ||
interval: 30s | ||
- duration: 1m | ||
interval: 1m | ||
- duration: 5m | ||
interval: 5m | ||
- duration: 30m | ||
interval: 15m | ||
- duration: 1h | ||
interval: 30m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snapshots and compaction should be at the root of the config:
snapshot:
interval: 10m
retention: 1h
levels:
- interval: 30s
- interval: 1m
- interval: 5m
- interval: 15m
- interval: 30m
Moved snapshot and compaction settings from replica level to root level. Changes: - Moved `snapshot:` section to root (was `snapshot-interval` under replica) - Moved `levels:` section to root (was `compaction:` under replica) - Fixed all test scripts: comprehensive, minio-s3, quick-validation, overnight, and overnight-s3 - Retained `retention-check-interval` under each replica config The old configuration structure was silently ignored because YAML unmarshaling in Go doesn't error on unknown fields by default. This is why tests didn't fail despite the incorrect structure. Config now follows the documented format from cmd/litestream/main_test.go and matches the litestream.io documentation examples. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Fixed! I've updated all test scripts to use the correct configuration structure with The reason the tests didn't fail with the incorrect config is that Go's YAML unmarshaling doesn't error on unknown fields by default - it silently ignores them. So the old I also verified that:
All five test scripts have been fixed in commit db41759. |
Summary
This PR improves the test scripts with comprehensive validation capabilities and adds MinIO-based S3 testing. The improvements address Ben's requirements for aggressive compaction testing and long-running validation.
Changes
Key Improvements
Test Results
Comprehensive 2-hour test:
MinIO S3 30-minute test:
Key Findings
Testing Instructions
All tests have been validated and are working correctly with the improvements in this PR.