Clone https://github.com/electron/electron-quick-start, then install the spectron and add test code by follow instructions from https://github.com/electron-userland/spectron#usage . The test code runs successfully, but the electron process stay in the background after the mocha test program exits. After running the test multiple times, too many processes are staying in the background. Repo of the code to reproduce this issue: https://github.com/tanshuai/spectron-quick-start Screenshot of this issue:  Node.js 14.16.0, Chromium 91.0.4472.164, and Electron 13.5.2, Spectron 15.0.0, macOS 11.6