mapbox / mapbox/mapbox-gl-js

Use real Web Workers for running unit tests

Open
#8,853 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

testing :100:
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.