-
Notifications
You must be signed in to change notification settings - Fork 0
refact tests #26
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
Merged
refact tests #26
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
8582a13 to
194f732
Compare
- Add pipefail to E2E test step to properly detect test failures in CI - Remove pytest-xdist parallel execution (causes Docker API 404 errors) - Enhance Elasticsearch wait to verify shard initialization (prevents 503 errors) - All 36 E2E tests now pass reliably in 4m10s 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Behavioral Change:
- Wait for index shards to be ready after PUT (index creation)
- Call /_cluster/health/{index}?wait_for_status=yellow&timeout=30s
- Prevents HTTP 503 errors when accessing newly created indices
Problem:
- E2E tests were failing with "503 Service Unavailable" errors
- Elasticsearch returned "NoShardAvailableActionException"
- Tests created indices and immediately queried them before shards were ready
Solution:
- Add waitForIndexReady() function to wait for yellow status
- Automatically called after successful PUT requests for index creation
- 30s timeout to prevent indefinite waiting
Test Results:
- All 7 Elasticsearch E2E tests now pass (previously 5 failed)
- All 36 E2E tests pass with no regressions
- Execution time: 4m09s (sequential)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
This commit upgrades Elasticsearch from 8.19.5 to 9.2.1 and adds a dedicated test step to verify Elasticsearch functionality before running E2E tests. Changes: - Upgrade Elasticsearch image to 9.2.1 in docker-compose.yaml - Add scripts/test-elasticsearch.sh to verify cluster health, index creation, document insertion, and search functionality - Add "Test Elasticsearch separately" step in GitHub Actions workflow before E2E tests to catch Elasticsearch issues early The new test script performs comprehensive checks: 1. Cluster health status (green/yellow) 2. Shard initialization status 3. Index creation and readiness 4. Document insertion 5. Search functionality 6. Index deletion This helps debug Elasticsearch issues independently from E2E tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This commit optimizes Elasticsearch v9.2.1 configuration and waiting logic to improve performance in CI environments while maintaining local development compatibility. Changes: docker-compose.yaml: - Add bootstrap.memory_lock=false to prevent memory lock issues - Disable cluster.routing.allocation.disk.threshold_enabled for CI - Set action.destructive_requires_name=false for testing elasticsearch-cli/main.go: - Improve waitForIndexReady() with polling mechanism (60 sec max) - Check both cluster status and initializing_shards count - Replace single wait_for_status request with polling loop - Add detailed warnings for timeout scenarios These optimizations address CI-specific issues where Elasticsearch v9 initialization and shard allocation are slower than in local environments. The polling approach ensures tests wait appropriately for index readiness rather than timing out prematurely. Local test results: 36 passed, 7 skipped in 254.80s 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Change `containers.run()` to detached mode for both `run_cli` and `run_shell` - Add explicit `container.wait(timeout=300)` (5-minute timeout) - Get logs after container completion - Check exit code and fail test if non-zero - Proper container cleanup on both success and error - Prevent indefinite hangs in CI when containers don't exit Fixes issue where E2E tests hung in GitHub Actions when Elasticsearch CLI operations took too long, causing 20-minute workflow timeouts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add `verbose` bool variable and ES_CLI_VERBOSE env var - Enhanced waitForIndexReady() with detailed retry logging - Shows attempt number, status, shard counts, and timing - Logs start/end of wait operations - Enhanced makeRequest() with request/response logging - Shows HTTP method, path, body preview - Logs response status, timing, and size - Logs errors with context - Add pytest allow permission to settings.local.json Helps diagnose Elasticsearch v9 performance issues in CI by providing detailed timing and status information for each operation. Enable with: ES_CLI_VERBOSE=1 or ES_CLI_VERBOSE=true 🤖 Generated with [Claude Code](https://claude.com/claude-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.
Uh oh!
There was an error while loading. Please reload this page.