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

fix: Run dependencies with non-existent ancient files earlier #1202

Merged
merged 2 commits into from Oct 21, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion snakemake/dag.py
Expand Up @@ -1040,7 +1040,7 @@ def update_needrun(job):
if job_ not in visited:
# TODO may it happen that order determines whether
# _n_until_ready is incremented for this job?
if all(f.is_ancient for f in files):
if all(f.is_ancient and f.exists for f in files):
# No other reason to run job_.
# Since all files are ancient, we do not trigger it.
continue
Expand Down
39 changes: 39 additions & 0 deletions tests/test_ancient_dag/Snakefile
@@ -0,0 +1,39 @@
shell.executable("bash")

rule all:
input:
"d.out",

rule A:
output:
"a.out",
shell:
"echo 'text' > {output}"

rule B:
input:
ancient("a.out"),
output:
"b_{i}.out",
shell:
"cat {input} > {output}"

# rule C is required for #946
# use `range(20)` so test will pass in < 5% of cases where issue is present
rule C:
input:
expand("b_{i}.out", i=list(range(20))),
output:
"c.out",
shell:
"cat {input} > {output}"

# For #946, 'a.out' is required as input, but does not need to be `ancient()`
rule D:
input:
"a.out",
"c.out",
output:
"d.out",
shell:
"cat {input} > {output}"
Empty file.
4 changes: 4 additions & 0 deletions tests/tests.py
Expand Up @@ -1320,3 +1320,7 @@ def test_github_issue1158():
dpath("test_github_issue1158"),
cluster="./qsub.py",
)


def test_ancient_dag():
run(dpath("test_ancient_dag"))