How to use set_exitcode method in yandex-tank

Best Python code snippet using yandex-tank

util.py

Source:util.py Github

copy

Full Screen

...25 def parse_time_value(s):26 if s[-1] != "s":27 raise ValueError('Cannot parse "{0}" as a time value.'.format(s))28 return float(s[:-1])29 def set_exitcode(new):30 if "exitcode" in result_values:31 old = result_values["exitcode"]32 assert (33 old == new34 ), "Inconsistent exit codes {} and {} from VerifierCloud".format(old, new)35 else:36 result_values["exitcode"] = new37 for key, value in values:38 value = value.strip()39 if key in ["cputime", "walltime"]:40 result_values[key] = parse_time_value(value)41 elif key == "memory":42 result_values["memory"] = int(value.strip("B"))43 elif key == "exitcode":44 set_exitcode(benchexec.util.ProcessExitCode.from_raw(int(value)))45 elif key == "returnvalue":46 set_exitcode(benchexec.util.ProcessExitCode.create(value=int(value)))47 elif key == "exitsignal":48 set_exitcode(benchexec.util.ProcessExitCode.create(signal=int(value)))49 elif (50 key in ["host", "terminationreason", "cpuCores", "memoryNodes"]51 or key.startswith("blkio-")52 or key.startswith("cpuenergy")53 or key.startswith("energy-")54 or key.startswith("cputime-cpu")55 ):56 result_values[key] = value57 elif key not in ["command", "timeLimit", "coreLimit", "memoryLimit"]:58 result_values["vcloud-" + key] = value59 return result_values60def parse_frequency_value(s):61 if not s:62 return s...

Full Screen

Full Screen

vcloudutil.py

Source:vcloudutil.py Github

copy

Full Screen

...14 def parse_time_value(s):15 if s[-1] != "s":16 raise ValueError(f'Cannot parse "{s}" as a time value.')17 return float(s[:-1])18 def set_exitcode(new):19 if "exitcode" in result_values:20 old = result_values["exitcode"]21 assert (22 old == new23 ), f"Inconsistent exit codes {old} and {new} from VerifierCloud"24 else:25 result_values["exitcode"] = new26 for key, value in values:27 value = value.strip()28 if key in ["cputime", "walltime"]:29 result_values[key] = parse_time_value(value)30 elif key == "memory":31 result_values["memory"] = int(value.strip("B"))32 elif key == "exitcode":33 set_exitcode(benchexec.util.ProcessExitCode.from_raw(int(value)))34 elif key == "returnvalue":35 set_exitcode(benchexec.util.ProcessExitCode.create(value=int(value)))36 elif key == "exitsignal":37 set_exitcode(benchexec.util.ProcessExitCode.create(signal=int(value)))38 elif (39 key in ["host", "terminationreason", "cpuCores", "memoryNodes", "starttime"]40 or key.startswith("blkio-")41 or key.startswith("cpuenergy")42 or key.startswith("energy-")43 or key.startswith("cputime-cpu")44 ):45 result_values[key] = value46 elif key not in ["command", "timeLimit", "coreLimit", "memoryLimit"]:47 result_values["vcloud-" + key] = value48 return result_values49def parse_frequency_value(s):50 # Contrary to benchexec.util.parse_frequency_value, this handles float values.51 if not s:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run yandex-tank automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful