背景:

部门近来准备进行 APP-UI 自动化测试框架的实施,对市面上相关的框架做了初步调研,Appnium 偏重,再加上 macaca 可以和 python(大部分测试人员为 python 知识储备) 无缝对接,所以选择了开源的 macaca 进行落地,前路一路无话,了解 nodejs 基础,部署环境,进行基本用例设计.用例设计完毕后也不能一味的本地执行,So 考虑需要分离部署和分布式执行,因此主角 reliable 开始登场了.

配置:

- Reliable master server OS->CentOS release 6.9 (Final)
- Reliable master server system 内核->2.6.32-642.6.1.el6.x86_64
- Reliable master node version->v8.12.0
- Reliable slave OS->window7

过程:

Reliable 部署过程参考---一步步布署 Reliable 系列之-Master (非 Docker) (在此表示由衷的感谢@sencho,由于服务器系统内核版本较低所以选择了非 docker 方式部署😅 )

问题:

Reliable master 正常启动,Reliable slave 正常启动,master 日志显示已经成功有 slave 连接,master 后台创建任务日志报异常,slave 接收不到从服务器派发的任务信息

备注:

1. 系统搭建完毕如图 (系统搭建完毕后,还没来的及高兴,问题也随之而来):

2. Reliable Slave 日志:

    λ ./bin/reliable-macaca-slave-server -m 192.168.2.27:8888 --verbose
>> index.js:58:14 [master] pid:4560 worker fork success
>> index.js:61:14 [master] pid:4560 worker online
>> index.js:64:14 [master] pid:4560 listening worker id: 1, pid: 8968, address: 10.255.2.134:4000
>> index.js:149:12 [worker:1] pid:8968 slave init with
 { webPort: 8080,
  verbose: true,
  ios: false,
  port: 4000,
  master: 'http://192.168.2.27:8888',
  ip: '10.255.2.134' }
>> index.js:54:12 [worker:1] pid:8968 Zmq Reconnecting...
>> index.js:78:10 [worker:1] pid:8968 Connected to the master server.
>> index.js:9:10 [worker:1] pid:8968 base middlewares attached
>> render.js:15:8 [worker:1] pid:8968 render view path: D:\reliable-macaca-slave\web\views
>> index.js:15:12 [worker:1] pid:8968 middleware: inject registed
>> index.js:15:12 [worker:1] pid:8968 middleware: favicon registed
>> index.js:15:12 [worker:1] pid:8968 middleware: powerby registed
>> index.js:15:12 [worker:1] pid:8968 middleware: static registed
>> channel.js:69:16 [worker:1] pid:8968
<--- zmq message
{ sysInfo:
   { cpus:
      [ { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times:
           { user: 1092849,
             nice: 0,
             sys: 1105391,
             idle: 25109250,
             irq: 207668 } },
        { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times: { user: 175813, nice: 0, sys: 732190, idle: 26399191, irq: 499437 } },
        { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times: { user: 1004880, nice: 0, sys: 646374, idle: 25655815, irq: 5803 } },
        { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times: { user: 150634, nice: 0, sys: 114114, idle: 27042196, irq: 8970 } },
        { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times: { user: 1178088, nice: 0, sys: 830128, idle: 25298604, irq: 6349 } },
        { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times: { user: 116751, nice: 0, sys: 119075, idle: 27070869, irq: 6240 } },
        { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times: { user: 1026268, nice: 0, sys: 783000, idle: 25497302, irq: 5600 } },
        { model: 'Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz',
          speed: 2592,
          times: { user: 134706, nice: 0, sys: 110589, idle: 27061150, irq: 4524 } },
        [length]: 8 ],
     memory: 0.5015092058310607,
     type: 'Windows_NT',
     platform: 'win32',
     uptime: '0d 7h 35m',
     release: '6.1.7601',
     hostname: 'Anonymous-PC',
     port: undefined },
  type: 'ack',
  data: 'hello master',
  status: 'ack' }
>> Temp directory not existed, check after one day.
>> index.js:64:14 [master] pid:4560 listening worker id: 1, pid: 8968, address: 10.255.2.134:8080
>> Slave Web Server start with options
 { webPort: 8080,
  verbose: true,
  ios: false,
  port: 4000,
  master: 'http://192.168.2.27:8888',
  ip: '10.255.2.134' }
>> index.js:64:14 [master] pid:4560 listening worker id: 1, pid: 8968, address: 10.255.2.134:8080

3. Reliable master 服务器日志片段:

    >> manager.js:34:12 [master] pid:24385 connect to tcp://10.255.2.134:4000**###说明:10.255.2.134是slave机器ip,通过日志看到已经连接到master服务器上
>> run.js:87:14 [master] pid:24385 dispatch success with data 
 { message: 'project' }
>> project.js:19:12 [worker:7] pid:24425 insert new project queue record
>> run.js:87:14 [master] pid:24385 dispatch success with data 
 { message: 'dispatch' }
>> manager.js:103:14 [master] pid:24385 no available slaves to dispatch
>> manager.js:133:14 [master] pid:24385 no available slave to dispatch
>> run.js:87:14 [master] pid:24385 dispatch success with data 
 { message: 'project' }

4. 服务器显示 Slave 连接截图

5.在任务面板新建任务后,Reliable master 报如下错误

>> badgeboard.js:32:12 [worker:4] pid:26325 TypeError: Cannot read property 'status' of null
at dataAdapter (/data/app/reliable-master/web/controllers/badgeboard.js:24:25)
at dataAdapter.next (<anonymous>)
at onFulfilled (/data/app/reliable-master/node_modules/co/index.js:65:19)
at newTickHandler (/data/app/reliable-master/node_modules/mpromise/lib/promise.js:229:18)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)

请论坛中的各位大神帮忙看一下,不胜感谢!


↙↙↙阅读原文可查看相关链接,并与作者交流