Unverified Commit 4e877c01 authored by OJ Kwon's avatar OJ Kwon Committed by GitHub

test(fixture): prevent start failure teardowns whole process (#55760)

### What?

In some test failures we've been observing test result is not written at
all like


```
Failed to load test output [Error: ENOENT: no such file or directory, open 'test/e2e/app-dir/edge-runtime-node-compatibility/edge-runtime-node-compatibility.test.ts.results.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'test/e2e/app-dir/edge-runtime-node-compatibility/edge-runtime-node-compatibility.test.ts.results.json'
}
```

scrolling up, it was due to whole test process was taken down by calling
process.exit explicitly.

We want to collect test results for the failures still, so the PR amends
it for the cases if it's specified to continue on error.


Closes WEB-1628
parent 67294fcb
...@@ -196,7 +196,12 @@ export async function createNext( ...@@ -196,7 +196,12 @@ export async function createNext(
try { try {
nextInstance.destroy() nextInstance.destroy()
} catch (_) {} } catch (_) {}
process.exit(1)
if (process.env.NEXT_TEST_CONTINUE_ON_ERROR) {
throw err
} else {
process.exit(1)
}
} finally { } finally {
flushAllTraces() flushAllTraces()
} }
......
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