Skip to content

Commit

Permalink
Add debug logging around missing root jobs in failed workflow fixtures (
Browse files Browse the repository at this point in the history
#5045)

* Stop hiding intentionally-failing job log

* Collect output and check for expected state when trying to run failing workflow
  • Loading branch information
adamnovak authored Aug 3, 2024
1 parent 1505fb0 commit 18e90f4
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/toil/test/utils/toilDebugTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,32 @@ def _get_wdl_job_store_and_job_name(self):
job_store = os.path.join(self._createTempDir(), "tree")

logger.info("Running workflow that always fails")
try:
# Run an always-failing workflow
subprocess.check_call([
# Run an always-failing workflow
wf_result = subprocess.run(
[
"toil-wdl-runner",
os.path.abspath("src/toil/test/docs/scripts/example_alwaysfail_with_files.wdl"),
"--retryCount=0",
"--logCritical",
"--logDebug",
"--disableProgress",
"--jobStore",
job_store
], stderr=subprocess.DEVNULL)
],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding="utf-8",
errors="replace",
)
logger.debug("Always-failing workflow output: %s", wf_result.stdout)
if wf_result.returncode == 0:
raise RuntimeError("Failing workflow succeeded!")
except subprocess.CalledProcessError:
# Should fail to run
else:
logger.info("Task failed successfully")
pass

# Make sure that the job store we created actually has its job store
# root job ID file. If it doesn't, we failed during workflow setup and
# not because of a real failing job.
assert os.path.exists(os.path.join(job_store, "files/shared/rootJobStoreID")), "Failed workflow still needs a root job"

# Get a job name for a job that fails
job_name = "WDLTaskJob"
Expand Down

0 comments on commit 18e90f4

Please sign in to comment.