spec: allow connections to port 2049 (#33983)

This commit is contained in:
Milan Burda 2022-04-30 13:29:05 +02:00 committed by GitHub
parent ce562b6889
commit b55f9d868a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,13 @@ v8.setFlagsFromString('--expose_gc');
app.commandLine.appendSwitch('js-flags', '--expose_gc');
app.commandLine.appendSwitch('ignore-certificate-errors');
app.commandLine.appendSwitch('disable-renderer-backgrounding');
// Some ports are considered to be "unsafe" by Chromium
// but Windows on Microsoft-hosted agents sometimes assigns one of them
// to a Node.js server. Chromium refuses to establish a connection
// and the whole app crashes with the "Error: net::ERR_UNSAFE_PORT" error.
// Let's allow connections to those ports to avoid test failures.
// Use a comma-separated list of ports as a flag value, e.g. "666,667,668".
app.commandLine.appendSwitch('explicitly-allowed-ports', '2049');
// Disable security warnings (the security warnings test will enable them)
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true;