Closed radekBednarik closed 2 years ago
Could it be that you have the HTML report open in another Terminal? I tried to reproduce it on Windows, but was not able to, for me it shutdown always correctly and a new HTML report was successfully opened.
@mxschmitt okej, I tried to reproduce it, and it seems like this will happen, when:
retries:2
in playwright.config.jsEADDRINUSE
error should be thrown now and from now on after each test executionI tried a bunch of times to repro it, but was unfortunately not able to. What kind of Terminal are you using? (Powershell, cmd.exe, VSCode?)
Powershell, 7.1.5
~~Update: I was able to reproduce it! ~~
Could it be that you close the HTML report with CTRL + C and press then by accident N
?
I was only to reproduce it when doing that, when I pressed Y
, it was working all the time.
Unfortunately, no. I am doing, what I described in repro steps, no accidental key pressing.
I can also provide my (slightly modified to run without headless and only one test in one project) playwright.config.js
, if that helps:
const { join } = require("path");
const { cpus } = require("os");
require("dotenv").config();
const GLOBAL_SETUP_PATH = join(process.cwd(), "common/globals/globalSetup.js");
const JUNIT_RESULTS_PATH = join(process.cwd(), "results.xml");
const TOUCHPOINT = process.env.TOUCHPOINT;
module.exports = {
// setup for all browsers
use: {
headless: true,
viewport: { width: 1920, height: 1080 },
ignoreHTTPSErrors: true,
trace: "on-first-retry",
// screenshot: "only-on-failure",
// video: "retain-on-failure",
// options for worker scoped context
wContextOptions: {
viewport: { width: 1920, height: 1080 },
ignoreHTTPSErrors: true,
// screenshot: "only-on-failure",
// video: "retain-on-failure",
},
},
timeout: 60000,
globalSetup: GLOBAL_SETUP_PATH,
testMatch: `**/${TOUCHPOINT}/spec/configurationStarted/cz.spec.js`,
workers: process.env.CI ? 8 : cpus().length / 2,
reportSlowTests: null,
retries: 2,
reporter: [["dot"], ["junit", { outputFile: JUNIT_RESULTS_PATH }], ["html"]],
projects: [
{
name: "Chromium",
use: {
browserName: "chromium",
},
},
// {
// name: "WebKit",
// use: {
// browserName: "webkit",
// },
// },
],
};
The issue is that there is a process running on your system that keeps the 9223 port open. You should find the process that keeps the port open and kill it!
@pavelfeldman yes, I get that, but isn't the core issue here, that the process is left hanging in first place under some circumstances (described above)?
Reopening, was able to repro on a Mac. I was on an old Node.js version. After updating I could not reproduce.
A provisional fix related to this bug got landed, it will be a part of 1.17, let us know if you still encounter related issues!
Able to reproduce the same issue when adding only the following line:
Sometimes happens to me. Still, if you're on linux you can do :
# get the PID
lsof -i@localhost | grep 'PORT_NUMBER_IN_USE'
kill -9 PID_FROM_ABOVE
Context:
Code Snippet
Describe the bug
After test finishes and html report is to be auto served, the error displayed above is thrown. When I try to open http://localhost:9323, the HTML report is shown, although it is not fully functional - for example clicking on the failed test case to show details will open only blank page.