Skip to content

Commit

Permalink
Merge branch 'jgfouca/scripts-acme/fix_another_race_in_test_status' i…
Browse files Browse the repository at this point in the history
…nto next (PR #380)

create_test: Fix race condition with PEND state in TestStatus

Move the PEND state addition from testcase_setup to create_test_impl.
This will ensure it gets created before wait_for_tests is run.

[BFB]
  • Loading branch information
Jeffrey Johnson committed Oct 21, 2015
2 parents ca84927 + 2398c62 commit 9107eb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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 @@ -270,7 +270,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

0 comments on commit 9107eb1

Please sign in to comment.