Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run_Test.py tweaks #1434

Merged
merged 1 commit into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions testing/adios2/engine/staging-common/run_test.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_teardown(testname) :
shutil.rmtree(testdir)

def touch(path):
with open(path, 'a'):
with open(path, 'w+'):
os.utime(path, None)

def clean_server_kill(writer):
Expand Down Expand Up @@ -55,6 +55,7 @@ def do_one_client_test(writer_cmd, reader_cmd) :
return_code = 0;
writer = subprocess.Popen(writer_cmd);
reader = subprocess.Popen(reader_cmd);
print "TestDriver: Waiting for Reader"
reader.wait();
print "TestDriver: Reader exit status was " + str(reader.returncode);
if reader.returncode != 0 :
Expand Down Expand Up @@ -112,15 +113,24 @@ def do_kill_readers_test(writer_cmd, reader_cmd, duration, interval) :
readers[reader_index].terminate();
readers[reader_index].wait();
readers.pop(reader_index);
print("Sleeping for time interval " + str(interval));
print("TestDriver: Sleeping for time interval " + str(interval));
sys.stdout.flush()
time.sleep(interval);
print("TestDriver: Done with test")
for reader in readers :
reader.wait();
print("TestDriver: Surviving reader exit status was " + str(reader.returncode));
if reader.returncode != 0 :
print("TestDriver: Reader failed, causing test failure");
return_code = 1;
reader.poll();
if reader.returncode is not None :
# if reader has already exited, we want to know if it thinks it succeeded and fail otherwise
if reader.returncode != 0 :
print("TestDriver: Unterminated Reader failed, causing test failure (return code) " + str(reader.returncode) )
return_code = 1
else :
print("TestDriver: Surviving Reader succeeded")
else :
# if reader hasn't already exited, kill it and ignore the exit status
print("TestDriver: Killing surviving Reader")
reader.terminate();
reader.wait();
sys.stdout.flush()
clean_server_kill(writer);
print("TestDriver: Writer exit status was " + str(writer.returncode));
Expand Down