Skip to content

Commit

Permalink
Merge pull request #4734 from ESMCI/jgfouca/some_e3sm_stuff
Browse files Browse the repository at this point in the history
Some updates for E3SM

jenkins: Canceling batch jobs needs to happen immediately when a signal occurs.
bless_test_results: Add option to lock baselines (remove group write)

Test suite: by hand
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes [CIME Github issue #]

User interface changes?:

Update gh-pages html (Y/N)?:
  • Loading branch information
jgfouca authored Jan 15, 2025
2 parents addf9e6 + dd1213d commit 954266b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CIME/Tools/bless_test_results
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ OR
"This option forces the bless to happen regardless.",
)

parser.add_argument(
"-l",
"--lock-baselines",
action="store_true",
help="Turn off group write access for baselines",
)

mutual_execution = parser.add_mutually_exclusive_group()

mutual_execution.add_argument(
Expand Down
16 changes: 16 additions & 0 deletions CIME/bless_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def bless_test_results(
pes_file=None,
bless_tests=None,
no_skip_pass=False,
lock_baselines=False,
new_test_root=None,
new_test_id=None,
exclude=None,
Expand Down Expand Up @@ -442,6 +443,21 @@ def bless_test_results(
if not success:
broken_blesses.append((test_name, reason))

if lock_baselines:
baseline_full_dir = os.path.join(
baseline_root_resolved,
baseline_name_resolved,
case.get_value("CASEBASEID"),
)
stat, out, _ = run_cmd(
f"chmod -R g-w {baseline_full_dir}", combine_output=True
)
if stat != 0:
msg = (
f"Failed to lock baselines for {baseline_full_dir}:\n{out}"
)
logger.warning(msg)

# Emit a warning if items in bless_tests did not match anything
if bless_tests:
for bless_test, bless_count in bless_tests_counts.items():
Expand Down
9 changes: 5 additions & 4 deletions CIME/jenkins_generic_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,13 @@ def jenkins_generic_job(
update_success=update_success,
)

logging.info("TEST ARCHIVER: Waiting for archiver thread")
archiver_thread.join()
logging.info("TEST ARCHIVER: Waiting for archiver finished")

if use_batch and CIME.wait_for_tests.SIGNAL_RECEIVED:
# Cleanup
cleanup_queue(test_root, test_id)

if not CIME.wait_for_tests.SIGNAL_RECEIVED:
logging.info("TEST ARCHIVER: Waiting for archiver thread")
archiver_thread.join()
logging.info("TEST ARCHIVER: Waiting for archiver finished")

return tests_passed
1 change: 1 addition & 0 deletions CIME/wait_for_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
###############################################################################
def signal_handler(*_):
###############################################################################
logging.warning("RECEIVED SIGNAL!")
global SIGNAL_RECEIVED
SIGNAL_RECEIVED = True

Expand Down

0 comments on commit 954266b

Please sign in to comment.