问题:在NodeJS平台上通过Mocha执行并在AWS ECS上运行的Selenuim Webdriver驱动的UI测试很慢到常规超时(超时= 120000毫秒,即2分钟)。
设置:
每个容器都使用以下JSON定义:
{
"requiresAttributes": [
{
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18",
"targetId": null,
"targetType": null
},
{
"value": null,
"name": "com.amazonaws.ecs.capability.ecr-auth",
"targetId": null,
"targetType": null
}
],
"taskDefinitionArn": "someDefinition",
"networkMode": "host",
"status": "ACTIVE",
"revision": 23,
"taskRoleArn": null,
"containerDefinitions": [
{
"volumesFrom": [],
"memory": 400,
"extraHosts": null,
"linuxParameters": null,
"dnsServers": null,
"disableNetworking": null,
"dnsSearchDomains": null,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80,
"protocol": "tcp"
}
],
"hostname": null,
"essential": true,
"entryPoint": [],
"mountPoints": [
{
"containerPath": "/dev/shm",
"sourceVolume": "hostDevShm",
"readOnly": null
}
],
"name": "foo-automation-container",
"ulimits": null,
"dockerSecurityOptions": null,
"environment": [],
"links": null,
"workingDirectory": null,
"readonlyRootFilesystem": null,
"image": "foo-docker-container-image",
"command": [],
"user": null,
"dockerLabels": null,
"logConfiguration": null,
"cpu": 0,
"privileged": null,
"memoryReservation": null
}
],
"placementConstraints": [],
"volumes": [
{
"host": {
"sourcePath": "/dev/shm"
},
"name": "hostDevShm"
}
],
"family": "foo-automation-tests"
}
我尝试了什么?
除了销毁和重新创建群集和任务 定义很多次,我已经设置了网络模式=主机,而我 添加了基于this链接的卷装入。
我确保这些测试运行完美无缺(并且在他们的 在内部部署VM上托管的容器上的常规速度 - 问题 仅使用AWS ECS配置。
我已经在网上搜索了这个问题的解决方案,包括SO,Docker的帮助论坛和AWS文档。
此时,我撞墙了。非常感激任何的帮助。
如果需要任何其他信息,请与我们联系。
答案 0 :(得分:0)
好的,我已经让它运行了 - 所有测试现在都在内部硬件的性能水平上执行。这是我做的:
在与任务关联的容器定义中:
一旦我做了这些事情,UI测试就会以通常的(<1秒)速度完美无缺地运行。