marqo-ai / py-marqo

Python client for Marqo
https://marqo.pages.dev/
Apache License 2.0
30 stars 5 forks source link

Always cleanup cloud indexes from tests #251

Closed vicilliar closed 3 weeks ago

vicilliar commented 1 month ago

Several test quality of life updates: -Concurrency control. Only 1 pipeline can run at a time. Prevents overlapping indexes. -Use last 4 digits of github run ID for test unique identifier (instead of UUID) so it can be shared between jobs. -Run cleanup_indexes regardless of outcome of integration test. -delete indexes script now always has wait_for_readiness=True -Remove wait_for_readiness in the cleanup section of the run_integration_tests job. This is because cleanup_indexes job will always run and wait til completion. Also so the deletion time is not recorded in the test run section. -wait_for_readiness loop now also waits for CREATING, MODIFYING, DELETING indexes, then sends a new delete request when they are READY or FAILED. -Add timeouts for workflow: 1 hour for github workflow, 45 minutes for python tests.

vicilliar commented 1 month ago

Proof that script will only clean up associated indexes (for this run).

vicilliar commented 1 month ago

Test Case:

vicilliar commented 1 month ago

1 Full Test run cancelled (5 indices deleted by cleanup script) Run: https://github.com/marqo-ai/py-marqo/actions/runs/10917619817/job/30301648628 ~37 minutes to delete all (including waiting for index to disappear from list image

vicilliar commented 1 month ago

Cancel run with no indexes to delete: image

vicilliar commented 1 month ago

Concurrency check (only 1 run is allowed at a time) image image

Works as intended.

vicilliar commented 1 month ago

Workflow TIMEOUT: After hitting 1 hour, with tests being stuck at test_config.py, entire test job failed out. Then Cleanup cloud indexes job was run automatically. This is intended behavior. image

Will investigate why tests were stuck at test_config.py