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

create_test: Fix race condition with PEND state in TestStatus #380

Merged
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions cime/scripts-acme/create_test_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ def _test_status_phase(self, test_name):
for phase in PHASES[0:made_it_to_phase+1]:
str_to_write += "%s %s %s\n" % (self._get_test_status(test_name, phase), test_name, phase)

if (not self._no_run and not self._is_broken(test_name)):
# Ensure PEND state always gets added to TestStatus file if we are
# about to run test
str_to_write += "%s %s %s\n" % (TEST_PENDING_STATUS, test_name, RUN_PHASE)

try:
test_status_file = os.path.join(self._get_test_dir(test_name), TEST_STATUS_FILENAME)
with open(test_status_file, "w") as fd:
Expand Down
1 change: 0 additions & 1 deletion cime/scripts/Tools/testcase_setup
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ my $testcase_begin = <<'END_BEGIN';
set TESTSTATUS_LOG = $CASEROOT/TestStatus.log
set TESTSTATUS_OUT_NLCOMP = $CASEROOT/TestStatus.nlcomp

echo "PEND ${CASEBASEID} RUN" >>&! $TESTSTATUS_OUT
touch $TESTSTATUS_LOG

set sdate = `date +"%Y-%m-%d %H:%M:%S"`
Expand Down