Skip to content

Commit 0e28a81

Browse files
chore: fix windows job due to ipv6 issues (#30437)
* chore: fix windows job due to ipv6 issues * Update server-base.ts * fix * limit to just windows * Update packages/network/lib/connect.ts
1 parent 4ba72c9 commit 0e28a81

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.circleci/workflows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mainBuildFilters: &mainBuildFilters
3030
- /^release\/\d+\.\d+\.\d+$/
3131
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
3232
- 'update-v8-snapshot-cache-on-develop'
33-
- 'misc/use_webdriver'
33+
- 'ryanm/chore/fix-windows-tests'
3434
- 'publish-binary'
3535

3636
# usually we don't build Mac app - it takes a long time
@@ -42,7 +42,7 @@ macWorkflowFilters: &darwin-workflow-filters
4242
- equal: [ develop, << pipeline.git.branch >> ]
4343
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
4444
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
45-
- equal: [ 'misc/use_webdriver', << pipeline.git.branch >> ]
45+
- equal: [ 'ryanm/chore/fix-windows-tests', << pipeline.git.branch >> ]
4646
- matches:
4747
pattern: /^release\/\d+\.\d+\.\d+$/
4848
value: << pipeline.git.branch >>
@@ -53,7 +53,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
5353
- equal: [ develop, << pipeline.git.branch >> ]
5454
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
5555
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
56-
- equal: [ 'misc/use_webdriver', << pipeline.git.branch >> ]
56+
- equal: [ 'ryanm/chore/fix-windows-tests', << pipeline.git.branch >> ]
5757
- matches:
5858
pattern: /^release\/\d+\.\d+\.\d+$/
5959
value: << pipeline.git.branch >>
@@ -76,7 +76,7 @@ windowsWorkflowFilters: &windows-workflow-filters
7676
- equal: [ develop, << pipeline.git.branch >> ]
7777
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
7878
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
79-
- equal: [ 'misc/use_webdriver', << pipeline.git.branch >> ]
79+
- equal: [ 'ryanm/chore/fix-windows-tests', << pipeline.git.branch >> ]
8080
- matches:
8181
pattern: /^release\/\d+\.\d+\.\d+$/
8282
value: << pipeline.git.branch >>
@@ -152,7 +152,7 @@ commands:
152152
name: Set environment variable to determine whether or not to persist artifacts
153153
command: |
154154
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
155-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "misc/use_webdriver" ]]; then
155+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/chore/fix-windows-tests" ]]; then
156156
export SHOULD_PERSIST_ARTIFACTS=true
157157
fi' >> "$BASH_ENV"
158158
# You must run `setup_should_persist_artifacts` command and be using bash before running this command

packages/network/lib/connect.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import dns, { LookupAddress, LookupAllOptions } from 'dns'
44
import _ from 'lodash'
55
import net from 'net'
66
import tls from 'tls'
7+
import os from 'os'
78

89
const debug = debugModule('cypress:network:connect')
910

@@ -39,6 +40,15 @@ export function getAddress (port: number, hostname: string): Bluebird<net.Addres
3940
.then((addresses) => {
4041
debug('got addresses %o', { hostname, port, addresses })
4142

43+
// ipv6 addresses are causing problems with cypress in cypress internal e2e tests
44+
// on windows, so we are filtering them out here
45+
if (process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT && os.platform() === 'win32') {
46+
debug('filtering ipv6 addresses %o', { hostname, port, addresses })
47+
addresses = addresses.filter((address) => {
48+
return address.family === 4
49+
})
50+
}
51+
4252
// convert to an array if string
4353
return Array.prototype.concat.call(addresses).map(fn)
4454
})

0 commit comments

Comments
 (0)