Skip to content
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

[Feature]: Add config option "worker(Max)Retries" instead of hardcoded maxRetries: 3 in jest-runner 🙂 #15125

Open
andry-brill opened this issue Jun 14, 2024 · 2 comments

Comments

@andry-brill
Copy link

andry-brill commented Jun 14, 2024

🚀 Feature Proposal

Could it be possible to add this._globalConfig.worker(Max)Retries to configure maxRetries instead of hardcoded 3 ? 🙂

test-runner/src/index.ts

    const worker = new Worker(require.resolve('./testWorker'), {
      enableWorkerThreads: this._globalConfig.workerThreads,
      exposedMethods: ['worker'],
      forkOptions: {serialization: 'json', stdio: 'pipe'},
      // The workerIdleMemoryLimit should've been converted to a number during
      // the normalization phase.
      idleMemoryLimit:
        typeof this._globalConfig.workerIdleMemoryLimit === 'number'
          ? this._globalConfig.workerIdleMemoryLimit
          : undefined,
      maxRetries: 3,
      numWorkers: this._globalConfig.maxWorkers,
      setupArgs: [{serializableResolvers: [...resolvers.values()]}],
    }) as JestWorkerFarm<TestWorker>;

Motivation

Why we can configure maxWorkers option but not maxRetries? 🧐

Example

I would love to have this value = 0 in my jest tests. 🙏🏻
As message Jest worker encountered 4 child process exceptions, exceeding retry limit not helping at all (usually).

Pitch

It's improvement to existing code (jest-runner).

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jul 14, 2024
@andry-brill
Copy link
Author

@github-actions github-actions bot removed the Stale label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant