Skip to content

Commit ef2904d

Browse files
committed
EADDRINUSE
1 parent a18bf73 commit ef2904d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

site/e2e/helpers.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,15 @@ export const createServer = async (
569569
port: number,
570570
): Promise<ReturnType<typeof express>> => {
571571
const e = express();
572-
await new Promise<void>((r) => e.listen(port, r));
572+
const server = e.listen(port, (error) => {
573+
if (error && error.code === 'EADDRINUSE') {
574+
console.log(`Port ${port} is already in use. Trying a different port...`);
575+
} else if (error) {
576+
console.error('An error occurred:', error);
577+
} else {
578+
console.log(`Server is listening on port ${port}`);
579+
}
580+
});
573581
return e;
574582
};
575583

site/e2e/playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default defineConfig({
3030
timeout: 60000,
3131
},
3232
],
33-
reporter: [["./reporter.ts"]],
33+
//reporter: [["./reporter.ts"]],
3434
use: {
3535
baseURL: `http://localhost:${port}`,
3636
video: "retain-on-failure",

0 commit comments

Comments
 (0)