also looking at this
fix(test): stop a leaked spawn mock hanging the gateway CLI tests (#2267), pin forwarded headers (#2265)
#2268
4 files
+57
-4
| @@ -45,7 +45,15 @@ describe('ProcessManager', () => { | ||
| 45 | 45 | }) |
| 46 | 46 | |
| 47 | 47 | afterEach(() => { |
| 48 | // No cleanup needed - Bun's spyOn handles cleanup automatically | |
| 48 | // Bun's spyOn does NOT restore on its own, and the `childProcess.spawn` spy | |
| 49 | // above is installed on the shared module object — so without this it stays | |
| 50 | // installed for every test file that runs after this one in the same `bun | |
| 51 | // test` process. Anything spawning a subprocess then gets the stub back | |
| 52 | // (pid 12345, no-op `on`/`stdout.on`), so its child never starts, never | |
| 53 | // prints and never exits: #2267, where `rpx --help` appeared to hang on | |
| 54 | // Linux CI purely because bun's file order happened to put this file first | |
| 55 | // there. Restore, and keep it restored. | |
| 56 | mock.restore() | |
| 49 | 57 | }) |
| 50 | 58 | |
| 51 | 59 | describe('isRunning', () => { |