rusackas opened a new pull request, #45594:
URL: https://github.com/apache/superset/pull/45594

   ### SUMMARY
   The `test` and `test-loud` npm scripts hard-code `--max-workers=80%`, so 
there's no way to run fewer Jest workers on a shared or busy machine short of 
bypassing the npm script. On a 12-core laptop that's 9 workers (plus whatever 
endpoint-security scanner rides along on the file churn), which is more than 
you want while a dev server or a second test run is going.
   
   This moves the default into `jest.config.js` as `maxWorkers: 
process.env.JEST_MAX_WORKERS || '80%'` and drops the flag from the two scripts. 
Nothing changes for CI or for anyone who doesn't set the variable: the resolved 
config still comes out at 80% of cores (verified with `--showConfig`), and an 
explicit `--maxWorkers` on the command line still overrides it, same as before. 
Setting `JEST_MAX_WORKERS=2` (or `50%`) caps the pool.
   
   Documented in the contributing docs and in `AGENTS.md` so coding agents 
running tests in a checkout default to a polite worker count too.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A
   
   ### TESTING INSTRUCTIONS
   ```bash
   cd superset-frontend
   npx jest --showConfig | grep maxWorkers                       # 80% of 
cores, as before
   JEST_MAX_WORKERS=2 npx jest --showConfig | grep maxWorkers    # 2
   JEST_MAX_WORKERS=50% npx jest --showConfig | grep maxWorkers  # half the 
cores
   JEST_MAX_WORKERS=2 npm run test -- src/SqlLab                 # runs with 2 
workers
   ```
   CI's sharded Jest job passes no worker flag, so it keeps the 80% default.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to