chore: use tinypool workerId as RSTEST_WORKER_ID#642
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR changes the worker identification mechanism to use tinypool's native workerId instead of a custom counter, improving alignment with the underlying worker pool implementation.
Key Changes:
- Renamed
workerIdtotaskIdinWorkerContextto reflect its actual purpose as a task identifier - Updated
RSTEST_WORKER_IDenvironment variable to use tinypool'sworkerIdwhen available, falling back totaskId
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/types/worker.ts | Renamed workerId field to taskId in WorkerContext type definition |
| packages/core/src/runtime/worker/index.ts | Updated environment variable assignment to prefer tinypool's workerId with taskId fallback |
| packages/core/src/pool/index.ts | Updated two call sites to use taskId property name instead of workerId |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
vitest got rid of tinypool in v4, due to some bugs they couldn't solve because of it |
In the future, Rstest may have its own pool implementation. For now, let's continue using it. |
Summary
use tinypool's workerId as
RSTEST_WORKER_ID.Related Links
https://github.com/tinylibs/tinypool?tab=readme-ov-file#exports
Checklist