Limit benching to 60s, before killing engines/threads and raising an exception (#225)

Adds a fourth possible OpenBenchBadBenchException exception during benching, for exceeding the max bench duration. This ensures that engines that infinitely stall, do not also lock up OpenBench clients. Additionally, make sure to clean up possible zombie processes that existed even in the case of a proper bench.
This commit is contained in:
Andrew Grant authored and GitHub committed 2024-06-17 11:53:45 -04:00
1 parent e2673c3cd1
commit 9e94da6b1f
3 files changed
+27 -9

No files matched your search

+6 -2
View File
@@ -160,5 +160,9 @@ if __name__ == '__main__':
private_net = configs[engine]['private'] and configs[engine].get('network')
net_path = os.path.join('Networks', configs[engine]['network']['sha']) if private_net else None
nps, nodes = run_benchmark(bin_path, net_path, private_net, args.threads, args.sets)
print (print_format % (engine, nps, nodes, nodes / max(1e-6, nps)))
try:
nps, nodes = run_benchmark(bin_path, net_path, private_net, args.threads, args.sets)
print (print_format % (engine, nps, nodes, nodes / max(1e-6, nps)))
except OpenBenchBadBenchException as error:
print ('%s: %s' % (engine, error))