Consistently guard restarts against concurrent auto updates (#21016)

This commit is contained in:
Tommaso Sciortino
2026-03-03 22:18:12 -08:00
committed by GitHub
parent bbcfff5cf1
commit 7e06559db2
10 changed files with 48 additions and 31 deletions

View File

@@ -5,7 +5,11 @@
*/
import { vi } from 'vitest';
import { RELAUNCH_EXIT_CODE, relaunchApp } from './processUtils.js';
import {
RELAUNCH_EXIT_CODE,
relaunchApp,
_resetRelaunchStateForTesting,
} from './processUtils.js';
import * as cleanup from './cleanup.js';
import * as handleAutoUpdate from './handleAutoUpdate.js';
@@ -19,6 +23,10 @@ describe('processUtils', () => {
.mockReturnValue(undefined as never);
const runExitCleanup = vi.spyOn(cleanup, 'runExitCleanup');
beforeEach(() => {
_resetRelaunchStateForTesting();
});
afterEach(() => vi.clearAllMocks());
it('should wait for updates, run cleanup, and exit with the relaunch code', async () => {