Unverified Commit c2103261 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Close active connections in prerender export test teardown

Co-authored-by: 's avatarWill Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
parent 8b1b7d5e
...@@ -2,7 +2,8 @@ import { wait } from 'next/dist/lib/wait' ...@@ -2,7 +2,8 @@ import { wait } from 'next/dist/lib/wait'
import path from 'path' import path from 'path'
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { renderViaHTTP, startStaticServer } from 'next-test-utils' import { renderViaHTTP, startStaticServer } from 'next-test-utils'
import { AddressInfo, Server } from 'net' import type { Server } from 'http'
import type { AddressInfo } from 'net'
describe('SSG Prerender export', () => { describe('SSG Prerender export', () => {
const { next, skipped } = nextTestSetup({ const { next, skipped } = nextTestSetup({
...@@ -29,7 +30,11 @@ describe('SSG Prerender export', () => { ...@@ -29,7 +30,11 @@ describe('SSG Prerender export', () => {
afterAll(async () => { afterAll(async () => {
if (server) { if (server) {
await new Promise<void>((resolve) => server.close(() => resolve())) await new Promise<void>((resolve) => {
server.close(() => resolve())
// The tests are done; active HTTP requests must not hold teardown open.
server.closeAllConnections()
})
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment