TypeError:使用金牛座运行分布式蝗虫时,必须为str,而不是NoneType

时间:2018-06-20 05:44:58

标签: python-3.x distributed locust taurus

我正在尝试为分布式蝗虫运行创建配置,我有一个带有已定义任务的.py脚本,并且我有简单的taurus配置以使其正常工作:

execution:
  executor: locust
  master: true
  slaves: 1
  scenario: tns
  concurrency: 10
  ramp-up: 10s
  iterations: 100
  hold-for: 10s

scenarios:
  tns:
    script: /usr/src/app/scenarios/locust_scenarios/sample.py

reporting:
- module: final-stats
  dump-csv: test_result.csv
- module: console
- module: passfail
  criteria:
   - avg-rt>250ms for 30s, continue as failed
   - failures>5% for 5s, continue as failed
   - failures>50% for 10s, stop as failed

然后我启动蝗虫从属节点:

python -m locust.main -f scenarios/locust_scenarios/sample.py --slave --master-host=localhost

并执行测试,这是日志

$ bzt -o modules.console.screen=gui locust_tests_execution_config.yaml
12:38:54 INFO: Taurus CLI Tool v1.12.0
12:38:54 INFO: Starting with configs: ['locust_tests_execution_config.yaml']
12:38:54 INFO: Configuring...
12:38:54 INFO: Artifacts dir: /Users/usr/Projects/load/2018-06-20_12-38-54.391229
12:38:54 WARNING: at path 'execution': 'execution' should be a list
12:38:54 INFO: Preparing...
12:38:54 WARNING: Module 'console' can be only used once, will merge all new instances into single
12:38:54 INFO: Starting...
12:38:54 INFO: Waiting for results...
12:38:55 WARNING: Please wait for graceful shutdown...
12:38:55 INFO: Shutting down...
12:38:56 INFO: Terminating process PID 54419 with signal Signals.SIGTERM (59 tries left)
12:38:57 INFO: Terminating process PID 54419 with signal Signals.SIGTERM (58 tries left)
12:38:57 ERROR: TypeError: must be str, not NoneType
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/cli.py", line 250, in perform
    self.engine.run()
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/engine.py", line 222, in run
    reraise(exc_info)
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/six/py3.py", line 84, in reraise
    raise exc
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/engine.py", line 204, in run
    self._wait()
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/engine.py", line 243, in _wait
    while not self._check_modules_list():
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/engine.py", line 230, in _check_modules_list
    finished = bool(module.check())
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/modules/aggregator.py", line 635, in check
    for point in self.datapoints():
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/modules/aggregator.py", line 401, in datapoints
    for datapoint in self._calculate_datapoints(final_pass):
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/modules/aggregator.py", line 664, in _calculate_datapoints
    self._process_underlings(final_pass)
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/modules/aggregator.py", line 649, in _process_underlings
    for data in underling.datapoints(final_pass):
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/modules/aggregator.py", line 401, in datapoints
    for datapoint in self._calculate_datapoints(final_pass):
  File "/Users/usr/.virtualenvs/stfw/lib/python3.6/site-packages/bzt/modules/locustio.py", line 221, in _calculate_datapoints
    self.read_buffer += self.file.get_bytes(size=1024 * 1024, last_pass=final_pass)
12:38:57 INFO: Post-processing...
12:38:57 INFO: Test duration: 0:00:03
12:38:57 INFO: Test duration: 0:00:03
12:38:57 INFO: Artifacts dir: /Users/usr/Projects/load/2018-06-20_12-38-54.391229
12:38:57 WARNING: Done performing with code: 1

蝗虫日志显示蝗虫奴隶已连接并准备蜂拥而至。

我应该怎么做才能使其运行? 谢谢

1 个答案:

答案 0 :(得分:0)