Use real Web Workers for running unit tests
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
Node 10.5 got the experimental [`worker_threads` module](https://nodejs.org/docs/latest-v12.x/api/worker_threads.html) that is now stable in Node 12.11, released a few weeks ago. We should remove our [mock implementation of `Worker`](https://github.com/mapbox/mapbox-gl-js/blob/master/src/util/web_worker.js) and use actual, threaded workers instead. We've had a number of issues over the years that were difficult to replicate in unit tests because our mock implementation serializes the execution.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/util/web_worker.js and the linked Node.js worker_threads documentation. Trace how unit tests currently use the mock Worker, then determine the integration points for real threaded workers. Done means the mock implementation is removed and unit tests run with actual workers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100