Run all configs without log parsing from simapp (#1)
This commit is contained in:
parent
ad86cd0495
commit
02a82a421b
|
@ -4,19 +4,9 @@ import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
def run_simulation(command):
|
def run_simulation(command):
|
||||||
# TODO: Graceful shutdown in simulation doesn't work yet, remove the ouput filtering once implemented.
|
start_time = time.time()
|
||||||
search_string = "ALL DONE"
|
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1, universal_newlines=True)
|
||||||
|
process.communicate()
|
||||||
with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1, universal_newlines=True) as process:
|
|
||||||
for line in iter(process.stdout.readline, ''):
|
|
||||||
if search_string in line:
|
|
||||||
# TODO: In simulation, subscriber will drop all remaining unpersisted records when the process
|
|
||||||
# is terminated, add some delay for filesystem to catch up with writing the output data.
|
|
||||||
time.sleep(5)
|
|
||||||
process.terminate()
|
|
||||||
return
|
|
||||||
|
|
||||||
process.communicate() # wait for the process to finish if it hasn't yet
|
|
||||||
|
|
||||||
def run_simulations(configs_path):
|
def run_simulations(configs_path):
|
||||||
for filename in os.listdir(configs_path):
|
for filename in os.listdir(configs_path):
|
||||||
|
|
Loading…
Reference in New Issue