Open
Description
Running tests doesn't seem to work at my machine:
dmitry.lomakin@dlomakin-mb sample-test-function % npm run test
> example@1.0.0 test /Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function
> wdio
Execution of 1 spec files started at 2021-06-30T18:30:45.095Z
2021-06-30T18:30:45.097Z INFO @wdio/cli:launcher: Run onPrepare hook
2021-06-30T18:30:45.099Z INFO @wdio/local-runner: Start worker 0-0 with arg:
[0-0] 2021-06-30T18:30:45.369Z INFO @wdio/local-runner: Run worker command: run
[0-0] RUNNING in chrome - /src/google.specs.js
[0-0] 2021-06-30T18:30:45.579Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2021-06-30T18:30:45.581Z INFO webdriver: [POST] http://testi-selen-*******.eu-central-1.elb.amazonaws.com:4444/wd/hub/session
[0-0] 2021-06-30T18:30:45.581Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: {
browserName: 'chrome',
'goog:loggingPrefs': [Object],
'goog:chromeOptions': [Object]
},
firstMatch: [ {} ]
},
desiredCapabilities: {
browserName: 'chrome',
'goog:loggingPrefs': { browser: 'ALL' },
'goog:chromeOptions': { args: [Array] }
}
}
[0-0] 2021-06-30T18:31:04.160Z WARN webdriver: Request failed due to Error forwarding the new session Error forwarding the request null
[0-0] 2021-06-30T18:31:04.160Z INFO webdriver: Retrying 1/3
2021-06-30T18:31:04.161Z INFO webdriver: [POST] http://testi-selen-*******.eu-central-1.elb.amazonaws.com:4444/wd/hub/session
[0-0] 2021-06-30T18:31:04.161Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: {
browserName: 'chrome',
'goog:loggingPrefs': [Object],
'goog:chromeOptions': [Object]
},
firstMatch: [ {} ]
},
desiredCapabilities: {
browserName: 'chrome',
'goog:loggingPrefs': { browser: 'ALL' },
'goog:chromeOptions': { args: [Array] }
}
}
[0-0] 2021-06-30T18:31:04.223Z WARN webdriver: Request failed due to Error forwarding the new session Error forwarding the request null
[0-0] 2021-06-30T18:31:04.223Z INFO webdriver: Retrying 2/3
2021-06-30T18:31:04.223Z INFO webdriver: [POST] http://testi-selen-*******.eu-central-1.elb.amazonaws.com:4444/wd/hub/session
[0-0] 2021-06-30T18:31:04.223Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: {
browserName: 'chrome',
'goog:loggingPrefs': [Object],
'goog:chromeOptions': [Object]
},
firstMatch: [ {} ]
},
desiredCapabilities: {
browserName: 'chrome',
'goog:loggingPrefs': { browser: 'ALL' },
'goog:chromeOptions': { args: [Array] }
}
}
[0-0] 2021-06-30T18:31:04.285Z WARN webdriver: Request failed due to Error forwarding the new session Error forwarding the request null
[0-0] 2021-06-30T18:31:04.286Z INFO webdriver: Retrying 3/3
2021-06-30T18:31:04.286Z INFO webdriver: [POST] http://testi-selen-*******.eu-central-1.elb.amazonaws.com:4444/wd/hub/session
[0-0] 2021-06-30T18:31:04.286Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: {
browserName: 'chrome',
'goog:loggingPrefs': [Object],
'goog:chromeOptions': [Object]
},
firstMatch: [ {} ]
},
desiredCapabilities: {
browserName: 'chrome',
'goog:loggingPrefs': { browser: 'ALL' },
'goog:chromeOptions': { args: [Array] }
}
}
[0-0] 2021-06-30T18:31:04.349Z ERROR webdriver: Request failed due to unknown error: Error forwarding the new session Error forwarding the request null
at getErrorFromResponseBody (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/webdriver/build/utils.js:121:10)
at Request._callback (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/webdriver/build/request.js:121:64)
at Request.self.callback (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/request/request.js:185:22)
at Request.emit (events.js:314:20)
at Request.EventEmitter.emit (domain.js:483:12)
at Request.<anonymous> (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/request/request.js:1154:10)
at Request.emit (events.js:314:20)
at Request.EventEmitter.emit (domain.js:483:12)
at IncomingMessage.<anonymous> (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:420:28)
[0-0] 2021-06-30T18:31:04.350Z ERROR webdriver: unknown error: Error forwarding the new session Error forwarding the request null
at getErrorFromResponseBody (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/webdriver/build/utils.js:121:10)
at Request._callback (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/webdriver/build/request.js:121:64)
at Request.self.callback (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/request/request.js:185:22)
at Request.emit (events.js:314:20)
at Request.EventEmitter.emit (domain.js:483:12)
at Request.<anonymous> (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/request/request.js:1154:10)
at Request.emit (events.js:314:20)
at Request.EventEmitter.emit (domain.js:483:12)
at IncomingMessage.<anonymous> (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:420:28)
[0-0] 2021-06-30T18:31:04.351Z ERROR @wdio/runner: Error: Failed to create session.
Error forwarding the new session Error forwarding the request null
at startWebDriverSession (/Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/node_modules/webdriver/build/utils.js:45:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[0-0] Error: Failed to create session.
Error forwarding the new session Error forwarding the request null
[0-0] FAILED in chrome - /src/google.specs.js
2021-06-30T18:31:04.469Z INFO @wdio/cli:launcher: Run onComplete hook
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:19
2021-06-30T18:31:04.469Z INFO @wdio/local-runner: Shutting down spawned worker
2021-06-30T18:31:04.722Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2021-06-30T18:31:04.723Z INFO @wdio/local-runner: shutting down
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! example@1.0.0 test: `wdio`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the example@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dmitry.lomakin/Sources/scaling-test-execution/run-selenium-tests-at-scale-using-ecs-fargate/sample-test-function/.npm/_logs/2021-06-30T18_31_04_738Z-debug.log
dmitry.lomakin@dlomakin-mb sample-test-function %
Any clue on what could break?
Metadata
Metadata
Assignees
Labels
No labels
Activity
hariohmprasath commentedon Jul 1, 2021
Hi @dmitry-lomakin,
I am glad you are trying this out, here are my suggestions:
S1: Are you in VPN? Sometimes I have seen this happening when using it with VPN, try disconnecting from VPN.
S2: Try increasing the value of
timeout_seconds
attribute in AWS ALB. I modifiedtimeout_seconds
attribute in my load balancer and you can do the same by following the below steps:Idle timeout
to4000
(thats the max value).After the updates, I ran 40 concurrent session of sample test case that's checked in part of the GitHub repo, in a loop and I could see at-least one session running in each of these nodes.
Test batch 1 (20 concurrent run - in view):

Test batch 2 (20 concurrent run - in view):

Grid console:

Hope this helps. Thanks
jonnysmith1981 commentedon Aug 2, 2021
This same error occurs for me too.
Not using a VPN
ALB timeout is 60 seconds. Error occurs within 5 or 6 seconds of running the test.
Using this project gives a remoteHost of 'null'

hariohmprasath commentedon Aug 5, 2021
Looks like the data nodes are not getting registered to master node. Ideally, when the data node starts up, it will use the below environment properties and startup commands to register itself to the master node:
Can you check the logs of the data nodes to see for any errors?
uorbe001 commentedon Mar 5, 2024
I'm getting the same errors, but seeing nothing on the logs other than the fact that the remoteHost url is null:
To me, this suggests this line https://github.com/aws-samples/run-selenium-tests-at-scale-using-ecs-fargate/blob/main/lib/index.js#L135 is failing to read the ip address correctly and thus returning a broken host. But I haven't been able to debug it yet, I'll try to figure it out tomorrow, but if someone already knows the answer (or I'm totally misled), I'd appreciate them sharing it.
uorbe001 commentedon Mar 6, 2024
Forgot to update this, but I managed to get this working by replacing the aforementioned line of code with:
command: ["PRIVATE=$(curl -s $ECS_CONTAINER_METADATA_URI_V4 | jq -r '.Networks[0].IPv4Addresses[0]') ; export REMOTE_HOST=\"http://$PRIVATE:5555\" ; /opt/bin/entry_point.sh"],