Merge pull request #82 from IntersectMBO/rm_retry
feat(scripts): add rm_retry for robust directory removal
feat(scripts): add rm_retry for robust directory removal
Introduce the rm_retry function in common.sh to improve reliability when removing directories, especially in container environments where "directory not empty" errors may occur. Update start-cluster scripts to use rm_retry instead of direct rm -rf calls, retrying removal up to 5 times before failing.
refactor(common.sh): improve argument handling and clarity
- Use local variables with descriptive names for target era and epoch in wait_for_era and wait_for_epoch functions, adding error messages for missing arguments. - Replace positional parameter usage with named variables for better readability and maintainability. - Add local variable declaration for loop variable in check_spend_success and wait_for_era to avoid polluting global scope.
fix(instance): clarify delay vs in-use error handling
Improve error messages and logic for handling delayed instances versus instances already in use. Now, attempting to use a delayed instance provides a clearer message and returns an error, while the distinction between "in use" and "delayed" is made explicit in both logs and flow.