fix(tool-web): bound HTML conversion work

This commit is contained in:
Tianyi Cui
2026-07-27 16:40:02 +08:00
parent ae18216199
commit 9801a0d102
11 changed files with 314 additions and 100 deletions

View File

@@ -45,8 +45,11 @@ export async function apply(ctx) {
})
// The fixture must never hold the process open past protocol shutdown.
server.unref()
ctx.effect(() => () => {
server.close()
server.closeAllConnections()
ctx.effect(() => async () => {
await new Promise((resolve, reject) => {
server.close(error => error ? reject(error) : resolve(undefined))
// Stop accepting first so a connection cannot arrive after the forced close.
server.closeAllConnections()
})
}, 'web-fetch-fixture-server')
}