mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-06 10:25:17 +00:00
Allow core to be interrupted
This commit is contained in:
parent
ec4b72ab3b
commit
01817d23ab
@ -167,6 +167,7 @@ class TankCore:
|
||||
self.artifacts_base_dir = '.'
|
||||
self.manual_start = False
|
||||
self.scheduled_start = None
|
||||
self.interrupted = False
|
||||
|
||||
def load_configs(self, configs):
|
||||
'''
|
||||
@ -266,7 +267,7 @@ class TankCore:
|
||||
if not self.plugins:
|
||||
raise RuntimeError("It's strange: we have no plugins loaded...")
|
||||
|
||||
while True:
|
||||
while not self.interrupted:
|
||||
begin_time = time.time()
|
||||
for plugin_key in self.plugins_order:
|
||||
plugin = self.__get_plugin_by_key(plugin_key)
|
||||
@ -279,8 +280,7 @@ class TankCore:
|
||||
self.log.debug("Polling took %s", diff)
|
||||
if (diff < 1):
|
||||
time.sleep(1 - diff)
|
||||
raise RuntimeError("Unreachable line hit")
|
||||
|
||||
return 1
|
||||
|
||||
def plugins_end_test(self, retcode):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user