Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
fix 'add cancel button on cetune status page' pr bug
Browse files Browse the repository at this point in the history
Signed-off-by: root <[email protected]>
  • Loading branch information
Shaoshian committed Mar 31, 2017
1 parent ab6add8 commit 76923d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions benchmarking/mod/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ def __init__(self):

def go(self, testcase, tuning):
try:
cancel_file = open("../conf/execute_op_type.conf","r")
execute_op_type = cancel_file.read().strip("\n")
if execute_op_type != "cancel_all":
self.execute_op_type = "execute"
if os.path.exists("../conf/execute_op_type.conf"):
cancel_file = open("../conf/execute_op_type.conf","r")
self.execute_op_type = cancel_file.read().strip("\n")
if self.execute_op_type != "cancel_all":
common.bash("rm -f %s/conf/%s" % (self.pwd, common.cetune_log_file))
common.bash("rm -f %s/conf/%s" % (self.pwd, common.cetune_error_file))
user = self.all_conf_data.get("user")
Expand Down Expand Up @@ -49,6 +51,8 @@ def go(self, testcase, tuning):
self.run()
except KeyboardInterrupt:
interrupted_flag = True
self.execute_op_type = "cancel_one"
os.system("echo 'cancel_one' > ../conf/execute_op_type.conf")
self.setStatus("Interrupted")
common.printout("WARNING","Caught Signal to Cancel this run, killing Workload now, pls wait")
self.real_runtime = time.time() - test_start_time
Expand Down
1 change: 1 addition & 0 deletions benchmarking/run_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def main(args):
if len(p) > 0 and p!="\n":
if not p[0].startswith('#'):
testcase_list.append({"engine":p[0],"parameter":p[1:]})
os.system("echo 'execute' > ../conf/execute_op_type.conf")
for testcase in testcase_list:
if testcase["engine"] == "qemurbd":
benchmark = qemurbd.QemuRbd()
Expand Down

0 comments on commit 76923d6

Please sign in to comment.