yandex-tank-api-client example doesn't work

578 Views Asked by At

I don't realize how yandex-tank-api-client example works. I've made following corrections in tank-example.py: replaced (the error was otherwise)

84: tsk = tankapi.shoot(*cfg)

with

84: tsk = tankapi.shoot(*cfg, f)

where f - is the function:

def f(status, t):
    print "Status: %s" % status

I've replaced example's load.yaml file with my file:

- tanks: ['localhost']
  config: ./load.ini
  log_name: task-A
  download: ['*.log','*.ini']
  upload: ['*.ammo']
  expected_codes: [0]

Where load.ini is:

[DEFAULT]
use_caching = 0

[phantom]
phantom_path = /home/krylov/prj/yandex/phantom/bin/phantom
phantom_modules_path = /home/krylov/prj/yandex/phantom/lib/phantom
address=localhost:8000
rps_schedule=const(10, 10s)
; Headers and URIs for GET requests

header_http = 1.1
headers = /
          [Host: 127.0.0.1]
          [Connection: close]
uris = /
       /instances
       /datastore
       /datastore-indexes

After I run yandex-tank-api-server on localhost and tank-example.py script test starts but it cannot leave the configure stage:

    2016-04-19 12:44:10,263 [DEBUG] Tank localhost: API returned code 200, contents:
{
    "status": "running", 
    "retcode": null, 
    "stage_completed": true, 
    "break": "configure", 
    "current_stage": "lock", 
    "tank_status": {}, 
    "failures": []
}
Status: 0

tank.log file ends by lines (you can here full tank.log):

2016-04-19 12:44:00,287 [INFO] yandex_tank_api.worker Changing the next break from lock to configure
2016-04-19 12:44:00,288 [WARNING] yandextank.core.tankcore Lock file present: /var/lock/lunapark_1WgKl6.lock
2016-04-19 12:44:00,288 [DEBUG] root No process[3]: [Errno 3] No such process
2016-04-19 12:44:00,288 [DEBUG] yandextank.core.tankcore Lock PID 13895 not exists, ignoring and trying to remove

I'd like to understand why PID not exists. Does the example have an error?

0

There are 0 best solutions below