feat(FN-5189): complete Step 3 — migrate supervised spawns
Fusion-Task-Id: FN-5189 Fusion-Task-Lineage: 4caa3f0a-af81-4c60-88e8-de229ed72e08
This commit is contained in:
committed by
gsxdsm
parent
87ea63c7c3
commit
818db4a714
@@ -3,6 +3,7 @@
|
||||
|
||||
import { spawn } from "node:child_process";
|
||||
import { createServer } from "node:http";
|
||||
import { superviseSpawn } from "@fusion/core";
|
||||
import { readFile, rm, stat, mkdtemp } from "node:fs/promises";
|
||||
import { existsSync } from "node:fs";
|
||||
import os from "node:os";
|
||||
@@ -469,7 +470,7 @@ async function findBrowserExecutable() {
|
||||
|
||||
async function launchBrowser(executable) {
|
||||
const userDataDir = await mkdtemp(path.join(os.tmpdir(), "fusion-dashboard-browser-smoke-"));
|
||||
const browser = spawn(executable, [
|
||||
const supervised = superviseSpawn(executable, [
|
||||
"--headless=new",
|
||||
"--disable-gpu",
|
||||
"--disable-dev-shm-usage",
|
||||
@@ -480,7 +481,9 @@ async function launchBrowser(executable) {
|
||||
"about:blank",
|
||||
], {
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
maxLifetimeMs: 60_000,
|
||||
});
|
||||
const browser = supervised.child;
|
||||
|
||||
try {
|
||||
const wsUrl = await new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user