[WIP] Retries mechanism improvements #5103
                
     Merged
            
            
          
  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.
  
    
  
    
Retries Mechanism Improvements - COMPLETED
Successfully implemented comprehensive improvements to CodeceptJS retry mechanisms to eliminate overlaps and provide better coordination.
✅ Implementation Complete:
Enhanced Global Retry System (
lib/listener/enhancedGlobalRetry.js)Enhanced RetryFailedStep Plugin (
lib/plugin/enhancedRetryFailedStep.js)Retry Coordinator Service (
lib/retryCoordinator.js)Comprehensive Testing
Documentation & Migration Guide (
docs/retry-mechanisms-enhancement.md)🔧 Key Improvements:
1. Priority System Prevents Conflicts:
I.retry()has highest priority2. Smart Coordination:
[Step Retry] Deferred to scenario retries (3 retries)deferToScenarioRetries: falseif needed3. Configuration Validation:
4. Enhanced Logging:
[Global Retry] Scenario retries: 3[Step Retry] Enabled with 2 retries for test: Login[Retry Coordinator] Registered scenario retry (priority: 30)📊 Testing Results:
Total: All tests passing with 100% backward compatibility maintained.
🔄 Migration Impact:
No Breaking Changes - All existing configurations continue to work with these improvements:
Optional Enhancements Available:
retryCoordinator.validateConfig()to check for conflicts🎯 Problem Resolution:
❌ Before: 3 scenario retries × 2 step retries = 6 total step executions
✅ After: Smart coordination prevents excessive retries while maintaining flexibility
❌ Before: Conflicting retry mechanisms with unclear precedence
✅ After: Clear priority system with automatic coordination
❌ Before: Confusing logs from multiple retry sources
✅ After: Enhanced logging clearly identifies retry sources and decisions
This implementation provides a robust foundation for retry coordination while maintaining full backward compatibility.
Fixes #5102.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.