LogoLogo
  • Welcome to Redefine
    • About
    • Quick Start ⏱️
      • Verification Examples
    • How Does It Work? 🔬
  • Configuration
    • Install Command
    • Configuration Parameters
    • Parallel Test Execution
      • Redefine Parallel
      • Remote Workers
        • Delayed Workers and Reruns
    • Selection Modes
      • Discover
      • Optimize
      • Fail-Fast
      • Prioritize
    • CI Platforms
    • Redefine Flow
  • Troubleshooting
    • Verify Troubleshooting
      • Environment Troubleshooting
      • Git Troubleshooting
      • Testing Frameworks
        • Cypress Troubleshooting
        • Pytest Troubleshooting
  • Integrations
    • Supported Technologies
    • AI Slack Notifications
Powered by GitBook
On this page
  1. Configuration
  2. Parallel Test Execution
  3. Remote Workers

Delayed Workers and Reruns

The startup time of CI machines may experience delays due to the unavailability of machines or infrastructure issues. The worker that has been delayed will have a considerably shorter effective compared to other workers. Consequently, there is a risk of important tests being missed.

Repeating the execution of a single worker can yield similar results.

Worker Identifier

To address the issue of delays and potential missed tests due to CI machine unavailability or infrastructure issues, you can utilize the worker_id optional parameter.

To implement this solution, use the following command:

redefine install --pytest --worker --worker-id=$WORKER_ID
redefine install --cypress --worker --worker-id=$WORKER_ID
redefine install --mocha --worker --worker-id=$WORKER_ID

Ensure that the WORKER_ID environment variable contains the worker identifier specific to your CI system.

Handling worker rerun

it's important to note that if you have repeated executions of a single worker without re-running the orchestrator, the effective time limit for each subsequent execution may be reduced to zero. To prevent this, you can include the rerun attempt as part of the worker_id.

Here's an example:

redefine install --pytest --worker --worker-id="${WORKER_ID}_${ATTEMPT}"
redefine install --cypress --worker --worker-id="${WORKER_ID}_${ATTEMPT}"
redefine install --mocha --worker --worker-id="${WORKER_ID}_${ATTEMPT}"

In this case, make sure to set the ATTEMPT environment variable to the rerun attempt counter. This approach guarantees that each attempt is assigned a unique identifier, avoiding a zero effective time limit for repeated executions.

By implementing these strategies, you can mitigate delays, manage worker execution, and minimize the risk of missing important tests in your CI workflow.

PreviousRemote WorkersNextSelection Modes

Last updated 1 year ago