mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-07 02:45:21 +00:00
fix bug with phantom timeout
This commit is contained in:
parent
fc82d0f7a7
commit
53fb5b1c7d
@ -112,7 +112,6 @@ class AbstractCriteria:
|
||||
RC_TIME = 21
|
||||
RC_HTTP = 22
|
||||
RC_NET = 23
|
||||
RC_INST = 24
|
||||
|
||||
def __init__(self):
|
||||
self.log = logging.getLogger(__name__)
|
||||
|
@ -14,7 +14,6 @@ import hashlib
|
||||
import ipaddr
|
||||
import multiprocessing
|
||||
import os
|
||||
import select
|
||||
import socket
|
||||
import string
|
||||
import subprocess
|
||||
@ -85,7 +84,7 @@ class PhantomPlugin(AbstractPlugin, AggregateResultListener):
|
||||
|
||||
if aggregator:
|
||||
aggregator.reader = PhantomReader(aggregator, self)
|
||||
self.timeout = aggregator.get_timeout()
|
||||
self.phantom.timeout = aggregator.get_timeout()
|
||||
aggregator.add_result_listener(self)
|
||||
|
||||
if not self.phout_import_mode:
|
||||
@ -219,7 +218,7 @@ class PhantomProgressBarWidget(AbstractInfoWidget, AggregateResultListener):
|
||||
|
||||
pb_width = screen.right_panel_width - 1 - len(str_perc)
|
||||
|
||||
res += color_bg + ' ' * int(pb_width * progress) + screen.markup.RESET + color_fg + '-' * (pb_width - int(pb_width * progress)) + screen.markup.RESET + ' '
|
||||
res += color_bg + '-' * int(pb_width * progress) + screen.markup.RESET + color_fg + '-' * (pb_width - int(pb_width * progress)) + screen.markup.RESET + ' '
|
||||
res += str_perc + "\n"
|
||||
|
||||
eta = 'ETA: %s' % eta_time
|
||||
@ -439,6 +438,7 @@ class PhantomReader(AbstractReader):
|
||||
return res
|
||||
|
||||
|
||||
# FIXME: 1 there is zeros in expected RPS reported
|
||||
def __get_expected_rps(self):
|
||||
'''
|
||||
Mark second with expected rps from stepper info
|
||||
@ -450,12 +450,14 @@ class PhantomReader(AbstractReader):
|
||||
return 0
|
||||
else:
|
||||
self.steps[0][1] -= 1
|
||||
return self.steps[0][0]
|
||||
return self.steps[0][0]
|
||||
|
||||
|
||||
class UsedInstancesCriteria(AbstractCriteria):
|
||||
'''
|
||||
Autostop criteria, based on active instances count
|
||||
'''
|
||||
RC_INST = 24
|
||||
|
||||
@staticmethod
|
||||
def get_type_string():
|
||||
|
@ -16,8 +16,9 @@ class AggregatorPluginTestCase(TankTestCase):
|
||||
|
||||
def test_run(self):
|
||||
self.foo.configure()
|
||||
self.assertEquals(11000, self.foo.get_timeout())
|
||||
self.foo.prepare_test()
|
||||
self.foo.reader=FakeReader(self.foo)
|
||||
self.foo.reader = FakeReader(self.foo)
|
||||
self.foo.start_test()
|
||||
retry = 0
|
||||
while self.foo.is_test_finished() < 0 and retry < 5:
|
||||
@ -29,7 +30,7 @@ class AggregatorPluginTestCase(TankTestCase):
|
||||
def test_run_final_read(self):
|
||||
self.foo.configure()
|
||||
self.foo.prepare_test()
|
||||
self.foo.reader=FakeReader(self.foo)
|
||||
self.foo.reader = FakeReader(self.foo)
|
||||
self.foo.start_test()
|
||||
self.foo.end_test(0)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user